简体   繁体   English

是否有类似“Firebug for IE”(用于调试 JavaScript)之类的东西?

[英]Is there something like "Firebug for IE" (for debugging JavaScript)?

I'm trying to fix some JavaScript bugs.我正在尝试修复一些 JavaScript 错误。 Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining?在 Firefox 中工作时,Firebug 使调试这些问题变得更加容易,但是当代码在 Firefox 上运行良好但 IE 却在抱怨时,您会怎么做?

you can also check out the IE Developer Toolbar which isn't a debugger but will help you analyze the contents of your code.您还可以查看IE Developer Toolbar ,它不是调试器,但可以帮助您分析代码的内容。

Visual Studio will help with the debugging Visual Studio将帮助调试

Fiddler should help analyse the traffic travelling to and from your browser Fiddler应该帮助分析进出浏览器的流量

您可以尝试使用Firebug Lite或使用 Visual Studio 来调试 JavaScript。

Since Internet Explorer 8, IE has been shipping with a built-in tool-set for debugging, troubleshooting, and generally helping in development of your pages/applications.自 Internet Explorer 8 以来,IE 一直带有一个内置工具集,用于调试、故障排除和通常帮助开发页面/应用程序。 You can access these tools by pressing F12 while in the browser.您可以通过在浏览器中按 F12 来访问这些工具。

HTML Tab HTML 标签

The HTML tab will let you peek into the DOM as the browser understands it. HTML 选项卡可让您查看浏览器所理解的 DOM。 As you select elements from the HTML view, their styles will be detailed on the right, with individual rules have the ability to be toggled on and off.当您从 HTML 视图中选择元素时,它们的样式将在右侧详细说明,并且可以打开和关闭各个规则。 You can also modify rules, and determine whether the styles on the element were inherited, or assigned explicitly.您还可以修改规则,并确定元素上的样式是继承的还是显式分配的。 Additionally, you can even tell which .css file they originate from.此外,您甚至可以分辨出它们来自哪个 .css 文件。

在此处输入图片说明

There is a bit more you can do in the HTML tab, such as review and modify attributes on elements, and even make changes to the layout of the element from within the layout section.您可以在 HTML 选项卡中执行更多操作,例如查看和修改元素的属性,甚至可以从布局部分更改元素的布局。 Additionally, you can make changes directly to the markup to quickly test out some structural ideas.此外,您可以直接对标记进行更改以快速测试一些结构性想法。

Script Tab脚本选项卡

For resolving JavaScript issues, you can watch the Console and the Script Tag.要解决 JavaScript 问题,您可以查看控制台和脚本标签。 If your script stumbles across an a call to an undefined method, you'll be alerted within your console.如果您的脚本偶然发现对未定义方法的调用,您将在控制台中收到警报。 The console also lets you run arbitrary JavaScript against your page, if you want to toggle items on or off, or try bind a handler to a button.如果您想打开或关闭项目,或者尝试将处理程序绑定到按钮,控制台还允许您针对您的页面运行任意 JavaScript。

The Script tab great as well as it will format your JavaScript for you, allow you to insert breakpoints, step in and over code blocks, and watch variables over time.脚本选项卡很棒,它可以为您设置 JavaScript 格式,允许您插入断点、单步执行代码块以及随着时间的推移观察变量。

在此处输入图片说明

If you've used Firebug, or even the Webkit Inspector, the F12 Developer Tools in Internet Explorer 8+ should be pretty familiar to you.如果您使用过 Firebug,甚至是 Webkit Inspector,那么您应该非常熟悉 Internet Explorer 8+ 中的 F12 开发人员工具。

Firebug lite doesn't work too well for me. Firebug lite 对我来说不太好用。 The Developer Toolbar just isn't good enough.开发人员工具栏还不够好。 There really is no great solution.真的没有很好的解决方案。

Have a look at DebugBar .看看DebugBar License is free for personal use许可证可免费供个人使用

For the DOM Inspector, try the Internet Explorer Developer Toolbar .对于 DOM Inspector,请尝试Internet Explorer Developer Toolbar

For the Net tab, try Fiddler .对于 Net 选项卡,请尝试Fiddler

For Javascript debugging, try Visual Web Developer 2008 Express Edition .对于 Javascript 调试,请尝试Visual Web Developer 2008 Express Edition (Or a higher edition of Visual Studio) (或更高版本的 Visual Studio)

Also, try DebugBar .另外,试试DebugBar

Visual Studio 2008 can do JavaScript debugging, you have to go to IE's Tools->Internet Options->Advanced and uncheck 'Disable Script Debugging (Internet Explorer)' in order for the browser to bubble up the errors it detects. Visual Studio 2008 可以进行 JavaScript 调试,您必须转到 IE 的工具->Internet 选项->高级并取消选中“禁用脚本调试 (Internet Explorer)”,以便浏览器弹出它检测到的错误。

Once you're in Visual Studio you basically have it's entire debugging arsenal at your disposal.进入 Visual Studio 后,您基本上可以使用整个调试工具。 It's not as integrated as Firebug, but it is way better than anything we used to have.它不像 Firebug 那样集成,但它比我们以前拥有的任何东西都要好得多。

i think it is better that you first install the ie core addon in firefox then load the page with ie addon and press f12.我认为最好先在firefox中安装ie核心插件,然后用ie插件加载页面并按f12。 good luck.祝你好运。

Make a bookmark in the favourites bar, and put this address as the URL:在收藏夹栏中制作书签,并将此地址作为 URL:

javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');

Then navigatge to the page you want and click the link.然后导航到您想要的页面并单击链接。 Firebug Lite will/should open up... Firebug Lite 将/应该打开...

I found a solution to this problem, you could simply stick this tag to the page you are trying to debug and it will open firebug:我找到了解决此问题的方法,您只需将此标签粘贴到您尝试调试的页面上,它就会打开 firebug:

<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>

Explanation from https://getfirebug.com/firebuglite#Stable来自https://getfirebug.com/firebuglite#Stable 的解释

I'm guessing this question was posted before the IE8 final came out, according tho some of the answers.根据一些答案,我猜这个问题是在 IE8 决赛出来之前发布的。

These days, IE8's inbuilt Developer Tools are great;如今,IE8 的内置开发者工具很棒; and while the JS debugging isn't as useful as Visual Studio the Dev Tools in general much better than Firebug in my opinion.虽然 JS 调试不如 Visual Studio 有用,但在我看来,开发工具总体上比 Firebug 好得多。 Between that and the Compatibility View Browser Mode I can handle all my IE6 development needs.在这和兼容性视图浏览器模式之间,我可以处理我所有的 IE6 开发需求。

If you're a serious Front-end Developer, give AJAX Edition a test run:如果您是一名认真的前端开发人员,请试运行 AJAX 版:

http://www.compuware.com/application-performance-management/ajax-performance-testing.html http://www.compuware.com/application-performance-management/ajax-performance-testing.html

It's a free tool that allows users' to understand what is causing performance and functional-related problems in modern AJAX/web Applications.它是一个免费工具,允许用户了解导致现代 AJAX/web 应用程序性能和功能相关问题的原因。

In IE, go to MenuBar->Tools Select Debugger Tools Hit F12 and enjoy.在 IE 中,转到 MenuBar->Tools 选择 Debugger Tools Hit F12 并享受。 It is far from Fire Bug, but suitable for some quick help它远离 Fire Bug,但适合一些快速帮助

There is always a way how to get around this issue, watch the video and you will be able to install firebug in 2 mins.总有一种方法可以解决这个问题,观看视频,您将能够在 2 分钟内安装 firebug。

install firebug on ie在 ie 上安装 firebug

Good luck祝你好运

IE8 beta 自带的我认为是 IE Developer 工具栏,但似乎比我上次在 IE7 上尝试工具栏的时候强大了很多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM