I am getting “Uncaught SyntaxError: Unexpected token <”
in the following code. Please point out the error.
Is it related to jQuery because when I remove the code
below the ‘load 3d’ comment it works without any errors.
Please Help.
<script type="text/javascript" src="/static/jstree/_lib/jquery.js"></script>
<script type="text/javascript" src="/static/jstree/jquery.jstree.js"></script>
<script type="text/javascript">
$(function () {
// load the 3D Script
$("#container").ready(function(){
$.getScript("json_model.js");
});
// load the jstree
$("#demo").jstree({
"json_data" : {
"ajax": {
"url": "/static/templates/json_tree.js",
"data":function(n){
}
}
},
"plugins" : ["themes", "json_data"]
}).bind("select_node.jstree", function (e, data){});
});
</script>
<div id="demo">
</div>
<div id="container">
</div>
What do you get when you hit
/static/templates/json_tree.jsby itself? Do you see JSON or Javascript? If you have Firebug, take a look at the Net tab to see what response you receive from the URL.If it’s seeing
<, it’s probably because the function expects Javascript or JSON, but is seeing HTML.