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