删除404文件未找到错误

问题描述:

大家好,从1天iam谷歌搜索,但到目前为止我没有得到任何答案。我的问题是当html图像标签上没有当前路径时,我得到了一个错误,如GET:net :: ERR_FILE_NOT_FOUND在控制台上。它只在chrome浏览器上发生,所以可以从控制台隐藏它plz给我建议

Hello all from 1 day iam googling but i didn't get any answer so far..here my problem is when there is no currect path on html image tag i got an error like GET:net::ERR_FILE_NOT_FOUND on console. It was happend only on chrome browser so is it possible to hide this from console plz give me suggitions

问题是404错误表明你的代码正在尝试让客户端浏览器显示一个不存在的文件:除了找到生成错误地址的代码部分并指定一个有效地址之外,你不能修复它。



您可以将其隐藏起来 - 但除非您记录错误并正确修复,否则这是一种糟糕的编码方式。



要隐藏它,您需要添加自己的自定义404处理程序: http://stackoverflow.com/questions/667053/best-way-to-implement-a-404-in-asp-net [ ^ ]
The problem is that a 404 error indicates that your code is trying to get the client browser to display a file that doesn't exist: you can't "fix that" except to find the part of your code that generates the wrong address and making it specify a valid address instead.

You can hide it yes - but it's a poor way to code unless you log the error and fix it properly.

To hide it, you need to add your own custom 404 handler: http://stackoverflow.com/questions/667053/best-way-to-implement-a-404-in-asp-net[^]