我尝试消除由于缺少源 (src) 而发生的 404 错误..
I try to eleminate an 404 error occuring because the source (src) is missing..
var $chart = $("<img />")
.addClass("trend-pic")
.error(function(){
console.log("error loading..")
});
try{
$chart.attr("src", jobs[counter].url + "test/trend")
}catch(err){
$chart.attr("src", "");
}
如果尝试了很多方法来捕获错误,即在末尾放置一个 .error(function(){}).使用 $chart.load() - 方法检查图像是否被加载?这些都没有帮助?
if tried many stuff to catch the error i.e. putting an .error(function(){}) at the end.
use the $chart.load() - method to check if the images gets loaded?
Non of those helped?
GET {myURLString} 404(未找到)
浏览器:Safari
你不能真正从控制台中删除那些 404 错误.您可以做的最好的事情是进行一些 ajax 调用并查看返回码,但随后您将被限制为仅向您自己的域请求.
You can't really delete those 404 errors from the console. The best you can do is make some ajax calls and see the return code, but then you'll be limited to request only to your own domain.
编辑--
哦,是的,这些错误将继续显示在请求"标签中!它们只是不会出现在控制台"标签中(在 Chrome 中).
Oh, and yes, those errors will keep showing in the "Requests" tab! They just won't appear in the "Console" tab (in Chrome).
这篇关于消除控制台中的 404 url 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Electron 渲染器进程中创建子窗口时如何修复How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器进程中创建子窗口
mainWindow.loadURL("https://localhost:3000/") 在 EmainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 应用程
Electron webContents executeJavaScript:无法在第二个 loaElectron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:无法在第二个 loadURL 上
如何在angular-cli的组件内使用电子浏览器窗口?how to use electron browser window inside components in angular-cli?(如何在angular-cli的组件内使用电子浏览器窗口?)
ElectronJS - 在 Windows 之间共享 redux 存储?ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之间共享 redux 存储?)
如何在电子应用程序中访问相机/网络摄像头?How to access camera/webcamera inside electron app?(如何在电子应用程序中访问相机/网络摄像头?)