gpt4 book ai didi

javascript - 包含 Backbone Js 和下划线 js 文件,但浏览器控制台显示错误

转载 作者:行者123 更新时间:2023-12-03 12:40:45 25 4
gpt4 key购买 nike

I downloaded backbone.js and underscore.js and included it in the tags and defined the model but the browser is showing uncaught error and anonymous function

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Backbone Twitter</title>
</head>
<body>

<h1>Backbone for Testing</h1>
<script src="backbone.js"></script>
<script src=" ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="underscore.js"></script>
<script>
var Tweet = Backbone.Model.extend({




});

console.log(new Tweet({author: 'ABCD', status: 'Hi Backbone Js' }));
</script>


</body>
</html>

I have watched tutorials they do the same way, very new to Backbonejs

最佳答案

您应该将backbone.js移到underscore.js之后,因为underscore是Backbone的依赖项。

关于javascript - 包含 Backbone Js 和下划线 js 文件,但浏览器控制台显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23536781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com