主干代码产生不可用的堆栈跟踪
我正在使用一个相对较大的主干代码库,似乎每当我遇到 JavaScript 错误时,无论它是什么。控制台中显示的堆栈跟踪看起来相同(示例如下)。我的所有模型/视图都是通过主干 .extend 方法创建的。还有其他人遇到这个问题吗,或者知道如何解决它?我通常必须将 console.log 语句放在各处才能找到错误的根源,这非常耗时。谢谢。
jquery-1.5.min.js:16 Uncaught InvalidConstructorArgs
d.extend._Deferred.f.resolveWith jquery-1.5.min.js:16
v jquery-1.5.min.js:16
d.support.ajax.d.ajaxTransport.send.c jquery-1.5.min.js:16
Im working with a relatively large backbone codebase, and it seems like whenever I get a javascript error, no matter what it is. The stacktrace that appears in the console looks identical (example below). All of my models/views are created via the backbone .extend method. Does anyone else have this problem, or know how to fix it?? I ususally have to put console.log statements everywhere to find the source of the error and its very time consuming. Thanks.
jquery-1.5.min.js:16 Uncaught InvalidConstructorArgs
d.extend._Deferred.f.resolveWith jquery-1.5.min.js:16
v jquery-1.5.min.js:16
d.support.ajax.d.ajaxTransport.send.c jquery-1.5.min.js:16
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
调试时,您应该使用未缩小版本的 jQuery、Underscore 和 Backbone。如果你这样做的话,生活会容易得多。
据我所知,您在
Backbone.sync
函数中的$.ajax
调用遇到了问题,但是很难判断您何时使用缩小的 JS。You should use an un-minified version of jQuery, Underscore and Backbone when debugging. Life will be a lot easier if you do it that way.
As far as I can tell, you are having a problem with your
$.ajax
call within theyBackbone.sync
function, but it is way too difficult to tell when you are working with minified JS.升级到Jquery 1.6.4解决了这个问题
Upgrading to Jquery 1.6.4 solved this problem