javascript - CodeMirror - load file on editor on page load -


i'd load inside codemirror editor local file on page load, i've tried using filerreader apis without success. tried use jquery .load() function can load file in generic textarea not in editor.

on page load wait data request complete before initializing codemirror

since jquery mentioned use example

$(function(){     $.get('path/to/codefile',  function(data){           $('textarea#editorid').val(data);           // init codemirror      })  }) 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -