我正在尝试使用Behance API,我有以下脚本:
bundles.Add(new ScriptBundle("~/x1").Include("~/scr/jquery.js", "~/scr/jqueryui.js",));
bundles.Add(new ScriptBundle("~/x2").Include("~/scr/backbone.js", "~/scr/underscore.js", "~/scr/be.js"));
在be.js
:
Behance = {
api_url : 'http://www.behance.net/v2/',
api_key: 'asgasgasgasga9s8g…'
};
然后在我的页面上我有这个:
@Scripts.Render("~/x1")
@Scripts.Render("~/x2")
<script>
// Set your API key in be.js
//Behance.api_key = // have set this in be.js
// Users
BehanceUser = new Behance.UserModel({ user: ‘UserName’ });
BehanceUser.fetch();
BehanceUser.getProjects();
BehanceUser.getCollections();
BehanceUser.getWips();
</script>
但我在Chrome控制台中收到以下错误:
Uncaught TypeError: Cannot call method 'each' of undefined
Uncaught ReferenceError: Behance is not defined
有谁能告诉我我在哪里犯了错误?