File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
blog/25-10-17/codemirror-in-the-browser Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < title > CodeMirror 5</ title >
6+
7+ < link href ="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.min.css " rel ="stylesheet ">
8+ < style >
9+ # editor {
10+ border : 1px solid # ccc ;
11+ height : 300px ;
12+ }
13+ </ style >
14+ </ head >
15+
16+ < body >
17+ < h2 > CodeMirror 6 Editor</ h2 >
18+ < div id ="editor ">
19+ </ div >
20+
21+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.min.js "> </ script >
22+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/mode/javascript/javascript.min.js "> </ script >
23+
24+
25+ < script >
26+ console . clear ( ) ;
27+
28+ var myCodeMirror = CodeMirror ( editor , {
29+
30+ value : "function myScript(){return 100;}\n" ,
31+ mode : "javascript" ,
32+ lineNumbers : true ,
33+ } ) ;
34+
35+
36+
37+ </ script >
38+ </ body >
39+ </ html >
You can’t perform that action at this time.
0 commit comments