在“检查元素”控制台部分中,我收到此错误:
获取http://.../img/controls.png 404(未找到)jquery-1.11.3.js:10208
额外:
(anonymous function) @ jquery-1.11.3.js:10208 jQuery.access @ jquery-1.11.3.js:4182 jQuery.each.jQuery.fn.(anonymous function) @ jquery-1.11.3.js:10204 shareSwitch @ valnet.social.js?v=2.0:170 (anonymous function) @ include.js?v=2.0:40 m.Callbacks.j @ jquery.js?ver=1.11.2:2 m.Callbacks.k.fireWith @ jquery.js?ver=1.11.2:2 m.extend.ready @ jquery.js?ver=1.11.2:2 J @ jquery.js?ver=1.11.2:2
当我点击错误时,它会发送给我:
// Create scrollLeft and scrollTop methods
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
return access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
win.document.documentElement[ method ] :
elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : jQuery( win ).scrollLeft(),
top ? val : jQuery( win ).scrollTop()
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length, null );
};
});
它突出显示了这一行:
return win ? (prop in win) ? win[ prop ] :
我就是不明白问题出在哪里。有没有办法追踪问题的根源?
最佳答案
这是一个CSS属性background-image试图获取不存在的图像。奇怪的是,Google Chrome 将其视为 JS 错误。
我只需删除背景图像。
关于javascript - jQuery v1.11.3 向我发送controls.png 404(未找到),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30225858/