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
Post a Comment