This question has moved to Skulpt and CodeMirror Issues because the answers I had did not answer the question.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Use
editor.getValue()
andeditor.setValue(textFromFileLoaded)
rather than getting/setting the value of the "textbox" element itself.A CodeMirror instance is almost entirely separate from the textarea it is constructed from. As you've seen, it won't notice changes made in the textarea, and won't propagate changes made in the editor to it (except specifically during a form submission).
Here is the code snippet
Open the snippet in a new window and Run it. It works well.
Here is the full code