可以防止403错误登录到Web控制台吗? [英] Possible to prevent 403 errors from logging to the web console?

查看:115
本文介绍了可以防止403错误登录到Web控制台吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些js / html / css,在某些情况下,在加载图片时遇到无害的403错误。

I have some js/html/css that will in certain situations, encounter harmless 403 errors when loading images.

有没有办法捕获这些错误并且阻止他们将错误记录到控制台?

Is there any way to catch these errors and to prevent them from logging errors to the console?

谢谢!

推荐答案

都能跟得上。如果浏览器只响应200以上的任何内容,您将在控制台中看到它。您需要在服务器端修复它。发送带有一些文字的200: {error:1}

nope. If the browser responds with just about anything but a 200, you are going to see it in the console. You will need to fix it on the server side. Send a 200 with some text: {"error":1}

这篇关于可以防止403错误登录到Web控制台吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆