2014-11-20 88 views

回答

2

你可能有一個錯字別的地方,它工作在附件中的例子

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
    <meta charset="utf-8"> 
 
    <script src="http://ajaxorg.github.io/ace-builds/src/ace.js"></script> 
 
    <style> 
 
    #editor1, #editor2 { position: absolute; top: 0; left: 0; right: 0; bottom: 0;} 
 
    #editor1 {bottom: 50%} 
 
    #editor2 {top: 50%} 
 
    </style> 
 
</head> 
 
<body> 
 
<div id="editor1">var + jshint</div> 
 
<div id="editor2">var + no jshint</div> 
 
<script> 
 
    var editor1 = ace.edit("editor1") 
 
    editor1.session.setMode("ace/mode/javascript"); 
 
    var editor2 = ace.edit("editor2") 
 
    editor2.session.setMode("ace/mode/javascript") 
 
    editor2.session.setOption("useWorker", false); 
 
</script> 
 
</body> 
 
</html>