2011-07-09 45 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

相關問題