2011-07-09 84 views
0

我在下面的代码中得到了“未捕获的SyntaxError:意外的令牌<”。请指出错误。 它与jQuery有关吗?因为当我删除'load 3d'注释下面的代码 时,它没有任何错误。未捕获的SyntaxError:意外的令牌<在jQuery中

请帮忙。


<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> 

+0

我的猜测是它会出现在你的'json_model.js'文件中,因为当你注释掉它的加载时,它可以正常工作。你可以发布'json_model.js'的内容吗? –

+1

在线是错误? 'json_model.js'中有'

1

您必须检查您的路径到js文件或更改文件js中的目录名称,有时服务器不会获取路径。例如,如果你有public和js dir公开,并且你也有相同的公开内容,但路径和http://www.somthing.com/js/jsfile.js和server不知道必须获取哪个文件。

+0

我使用/index.php作为路由器,并且由于URI位于虚拟子目录中,因此我的路径需要前缀“../”。感谢您的线索! – AVProgrammer

相关问题