default.html中
<html>
<head>...</head>
<body>
<script src="Model1.js"></script>
<script src="Model2.js"></script>
</body>
</html>
Model1.js
...
Model1 = Backbone.View.extend();
Model2.js
...
Model2 = Backbone.View.extend(
initialize: function(){
this.model1 = new Model1();
},
);
它給出了一個錯誤 - Uncaught ReferenceError: Model1 is not defined
。
然而,在單.html
它鍛鍊精整都 -
default.html中
<html>
<head>...</head>
<body>
<script>
...
Model1 = Backbone.View.extend();
...
Model2 = Backbone.View.extend(
initialize: function(){
this.model1 = new Model1();
},
};
</script>
</body>
</html>
我怎麼可能使它工作保持第一頁的分區?
準備好文件後,你打電話給他們嗎? – zer02
'腳本'標籤可能在'頭部'沒有? – MamaWalter
由於某些原因'腳本'標籤在'身體'在我的情況下,沒關係... – URL87