I am trying to make use of this Syntax highlighter. I have tried to implement their example and I always seem to get this error in firebug:
place is not a function else place(div);
Here is my code, I thought it was a path issue, but everything looks right:
<textarea id="code1" rows="20" cols="20">
select * from where this = done
</textarea>
<script type="text/javascript" src="codemirror/js/codemirror.js"></script>
<script type="text/javascript">
var editor = new CodeMirror('code1', {
height: "150px",
parserfile: "codemirror/contrib/sql/js/parsesql.js",
stylesheet: "css/sqlcolors.css",
textWrapping: true
});
</script>
If you look at the source code of that example page, its similar to mine yet, the text in the text area doesn't get highlighted and I always get that error.
Thanks all for any help
I am trying to make use of this Syntax highlighter. I have tried to implement their example and I always seem to get this error in firebug:
place is not a function else place(div);
Here is my code, I thought it was a path issue, but everything looks right:
<textarea id="code1" rows="20" cols="20">
select * from where this = done
</textarea>
<script type="text/javascript" src="codemirror/js/codemirror.js"></script>
<script type="text/javascript">
var editor = new CodeMirror('code1', {
height: "150px",
parserfile: "codemirror/contrib/sql/js/parsesql.js",
stylesheet: "css/sqlcolors.css",
textWrapping: true
});
</script>
If you look at the source code of that example page, its similar to mine yet, the text in the text area doesn't get highlighted and I always get that error.
Thanks all for any help
Share Improve this question edited Oct 14, 2012 at 21:50 jack 1,2631 gold badge11 silver badges7 bronze badges asked Apr 26, 2010 at 13:57 AbsAbs 58k103 gold badges282 silver badges417 bronze badges1 Answer
Reset to default 4Change the code that initializes CodeMirror to the following and I think it will work:
var editor = CodeMirror.fromTextArea('code1', {
height: "150px",
parserfile: "codemirror/contrib/sql/js/parsesql.js",
path: "codemirror/js/",
stylesheet: "css/sqlcolors.css",
textWrapping: true
});
The important parts are using CodeMirror.fromTextArea
rather than new CodeMirror
and providing a value for path
in the object passed into CodeMirror.fromTextArea
.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742398282a4436391.html
评论列表(0条)