jQuery的AJAX:如何prevent 404错误垃圾邮件铬DevTools? [英] jQuery ajax: how to prevent 404 errors spam in chrome DevTools?

查看:190
本文介绍了jQuery的AJAX:如何prevent 404错误垃圾邮件铬DevTools?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CouchDB通过jQuery AJAX沟通,和'404'错误是由REST合同的预期。但对于每一个以404结尾的请求,412左右,谷歌Chrome写DevTools控制台一个红色的错误行,像这样的:

I'm communicating with CouchDB via jQuery ajax, and '404' errors are expected by REST contract. But for each requests that ends with '404', '412' or so, google chrome write a red error line in DevTools console, like this:

是否有可能以某种方式配置jQuery的那么'404'没有为给定的请求错误?假的错误垃圾杂乱的输出,我可以错过真正的错误或某些的console.log ,而在寻找数百名假冒404和412的错误:)

Is it possible to somehow configure jQuery so '404' is not an error for given request? Fake errors spam clutter output and i can miss real errors or some console.log while looking at hundreds of fake '404' and '412' "errors" :).

推荐答案

这是不可能的编程方式,由于对脚本滥用错误的阻隔或过滤在控制台从Chrome用户隐藏其活动的潜力。

This is not possible programmatically, due to the potential for a script to misuse the blocking or filtering of errors in the console to hide its activities from the Chrome user.

您可以在通过错误控制台过程中过滤器的消息,警告,调试。

You can of course filter messages in the console by Error, Warn, Debug.

您可以将您的声音<一个href="https://groups.google.com/forum/#!searchin/google-chrome-developer-tools/filter%2420console%2420messages/google-chrome-developer-tools/X1fzw52Ci9Y/P2IfjHBLoE0J">those要求更强大的能力来筛选控制台消息的Chrome浏览器,所以当你查看控制台就可以过滤掉堵塞它的消息。其中一个帖子中确实提供了一个工具,来标记你自己的控制台消息,然后过滤。

You can add your voice to those asking for more powerful capabilities to filter console messages in Chrome, so when you view the console you can filter out the messages that clog it up. One of the posts does offer a tool to tag your own console messages and then filter them.

,你可以在自己的code登录时添加的风格吧。例如下面将使该消息中脱颖而出:

If you want to highlight an error in the console, you can add styles to it when logging in your own code. E.g the following will make the message stand out:

console.log("%cUser %s has %d points", "color:orange; background:blue; font-size: 16pt", userName, userPoints);

这篇关于jQuery的AJAX:如何prevent 404错误垃圾邮件铬DevTools?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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