未捕获的类型错误:对象 [object DOMWindow] 没有方法“set”在backbone-min.js上
当我的应用程序中包含主干时,我收到此错误消息,
未捕获类型错误:对象 [object DOMWindow] 没有方法“set”
但我在主干之前加载了 jquery (1.4.4) 和 underscore.js (1.1.7),为什么这个方法仍然丢失?
I am receiving this error message when including backbone in my application,
Uncaught TypeError: Object [object DOMWindow] has no method 'set'
but I have jquery (1.4.4) and underscore.js (1.1.7) loaded before backbone, why is this method still missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
或者您正在实例化一个没有
new
前缀的模型,这会导致它绑定到全局窗口而不是this
。 SO 参考。Or you are instantiating a model without
new
prefix which would cause it to be bound to global window instead ofthis
. SO reference.仅根据错误消息,我会在您的代码中搜索
this.set
。您似乎引用this
并期望它是一个模型,但该函数未正确绑定。Based solely on the error message, I would search your code for
this.set
. It appears that you're referencingthis
with the expectation that it's a model, but the function isn't bound correctly.