热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何抑制我没有开发的网站的javascript错误?-HowtosuppressjavascripterrorsforsitesI'mnotdeveloping?

IliketokeepjavascriptdebuggingenabledinmybrowsersowhenImdevelopingmyowncodeIcani

I like to keep Javascript debugging enabled in my browser so when I'm developing my own code I can instantly see when I've made an error.

我喜欢在我的浏览器中启用Javascript调试,所以当我开发自己的代码时,我可以立即看到我出错的时候。

Of course this means I see errors on apple.com, microsoft.com, stackoverflow.com, cnn.com, facebook.com. Its quite fun sometimes to see just how much awful code there is out there being run by major sites but sometimes it gets really annoyed.

当然这意味着我在apple.com,microsoft.com,stackoverflow.com,cnn.com,facebook.com上看到了错误。有时看到有多少糟糕的代码存在于主要网站,但有时它真的很恼火,这很有趣。

I've wondered for YEARS how to change this but never really got around to it. Its particularly annoying today and I'd really like to know of any solutions.

我想知道如何改变这一点但从未真正解决过这个问题。今天特别烦人,我真的很想知道任何解决方案。

The only solution I have is : use a different browser for everyday browsing.

我唯一的解决方案是:使用不同的浏览器进行日常浏览。

I'm hopin theres some quick and easy plugin someone can direct me to where I can toggle it on and off based upon the domain i'm on.

我有一些快速简单的插件,有人可以指引我到我可以根据我所在的域打开和关闭的地方。

Edit: I generally use IE7 for everyday browsing

编辑:我通常使用IE7进行日常浏览

8 个解决方案

#1


Firebug lets you enable/disable debugging for different domains.

Firebug允许您启用/禁用不同域的调试。

#2


Script Debugging in IE7 is controlled by a registry key. (An addon could probably toggle it. I just don't know of any.)

IE7中的脚本调试由注册表项控制。 (一个插件可能会切换它。我只是不知道。)

So, how I handle this is to write a registry script to turn it on or off. Then, I put a link to those scripts on my windows quick-launch bar and change their icons to be more appropriate. Then, I can just click one of the links to turn on or off IE script debugging.

因此,我如何处理这个是编写一个注册表脚本来打开或关闭它。然后,我在Windows快速启动栏上放置了这些脚本的链接,并将其图标更改为更合适。然后,我只需单击其中一个链接即可打开或关闭IE脚本调试。

Turn Off:

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Disable Script Debugger"="yes"
"DisableScriptDebuggerIE"="yes"

Turn ON:

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Disable Script Debugger"="no"
"DisableScriptDebuggerIE"="no"

#3


Firefox lets you use different profiles. Each profile can have separate preferences, themes and plugins. Start firefox on Windows this way: firefox.exe -ProfileManager to create or manage profiles.

Firefox允许您使用不同的配置文件。每个配置文件可以有单独的首选项,主题和插件。以这种方式在Windows上启动firefox:firefox.exe -ProfileManager来创建或管理配置文件。

I use Firefox and Webkit for web debugging and Safari for regular web browsing, however. Firefox is just better for web development, and I prefer Safari overall.

但是,我使用Firefox和Webkit进行Web调试,使用Safari进行常规Web浏览。 Firefox对于Web开发来说更好,我更喜欢Safari。

#4


I keep those annoying popups on for Internet Explorer, and you're right. It's amazing how few developers ever bother testing their code in IE. As a web developer, it's sorta your duty, right? Seeing as how it still accounts for like 60% of traffic to most sites.

我为Internet Explorer保留了那些恼人的弹出窗口,你说得对。令人惊讶的是,很少有开发人员在IE中测试他们的代码。作为一名网络开发者,这是你的职责,对吧?看到它仍占大多数网站流量的60%。

Anyway, in answer to your question, I simply switched to Chrome for everyday browsing, and only use IE for testing and developing.

无论如何,在回答你的问题时,我只是切换到Chrome进行日常浏览,只使用IE进行测试和开发。

#5


You have two options.

你有两个选择。

  • Change and use a browser that allows you to have site specific configuration (check out Firefox with Firebug), or
  • 更改并使用允许您具有站点特定配置的浏览器(使用Firebug检查Firefox),或

  • Use different browsers for developing and everyday use.

  • 使用不同的浏览器进行开发和日常使用。

    #6


    CompanionJS doesn't let you toggle debugging on a domain basis, but makes the error messages less obtrusive for casual surfing, and makes script debugging in general more user friendly.

    CompanionJS不允许您在域的基础上切换调试,但使得错误消息不那么突兀于休闲冲浪,并使脚本调试通常更加用户友好。

    #7


    Chrome doesnt bug you unless you first open the Javascript debugger window

    除非您先打开Javascript调试器窗口,否则Chrome不会给您带来任何问题

    #8


    If you want to test and debug Javascript, Firefox and Firebug are unrivalled in terms of features and ease of use. Chrome is not as powerful as Firebug, no matter what anyone else tells you.

    如果您想测试和调试Javascript,Firefox和Firebug在功能和易用性方面是无与伦比的。无论别人告诉你什么,Chrome都没有Firebug那么强大。


    推荐阅读
    author-avatar
    李国龙度_476
    这个家伙很懒,什么也没留下!
    PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
    Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有