JavaScript-Tools zur Fehlerbehebung in Internet Explorer

original title: "JavaScript Troubleshooting Tools in Internet Explorer"


I use Firebug and the Mozilla JS console heavily, but every now and then I run into an IE-only JavaScript bug, which is really hard to locate (ex: error on line 724, when the source HTML only has 200 lines).

I would love to have a lightweight JS tool (a la firebug) for Internet Explorer, something I can install in seconds on a client's PC if I run into an error and then uninstall. Some Microsoft tools take some serious download and configuration time.

Any ideas?

Ich benutze Firebug und die Mozilla JS-Konsole stark, aber hin und wieder stoße ich auf einen Nur-IE-JavaScript-Fehler, der wirklich schwer zu finden ist (z. B. Fehler in Zeile 724, wenn der Quell-HTML-Code nur ...

Dies ist die Zusammenfassung nach der Übersetzung. Wenn Sie die vollständige Übersetzung anzeigen möchten, klicken Sie auf das Symbol "Übersetzen"

Alle Antworten
  • Translate

    You might find Firebug Lite useful for that.

    Its bookmarklet should be especially useful when debugging on a user's machine.

  • Translate

    Since Internet Explorer 8, IE has been shipping with a pretty impressive set of tools for JavaScript debugging, profiling, and more. Like most other browsers, the developer tools are accessible by pressing F12 on your keyboard.

    Script Tab

    The Script tab is likely what you'll be interested in, though the Console, Profiler, and Network tabs get plenty of use as well while debugging applications.

    enter image description here

    From the Script tab you can:

    • Format JavaScript to make it more readable
    • Move from source to source of various resources on the page
    • Insert breakpoints
    • Move in and over lines of code while stepping through its execution
    • Watch variables
    • Inspect the call stack to see how code was executed
    • Toggle breakpoints
    • and more...

    Console Tab

    The console tab is great for when you need to execute some arbitrary code against the application. I use this to check the return of certain methods, or even to quickly test solutions for answers on Stack Overflow.

    enter image description here

    Profiler Tab

    The profile is awesome if you're looking for long-running processes, or trying to optimize your code to run smoother or make fewer calls to resource-intensive methods. Open up any page and click "Start profiling" from the Profiler tab to start recording.

    While the profiler is working, you can move about the page, performing common actions. When you feel you've recorded enough, hit "Stop profiling." You will then be shown a summary of all functions ran, or a call tree. You can quickly sort this data by various columns:

    enter image description here

    Network Tab

    The network tab will record traffic on your site/application. It's very handy for finding files that aren't being downloaded, hanging, or for tracking data that is being requested asynchronously.

    Within this tab you can also move between a Summary view and a Detailed view. Within the Detailed view you can inspect headers sent with requests, and responses. You can view cookie information, check the timing of events, and more.

    enter image description here

    I'm not really doing the IE Developer Tools justice - there is a lot of uncovered ground. I would encourage you to check them out though, and make them a part of your development.

  • Translate

    I would recommend Companion JS.

    This is the free version of Debug Bar but I find it easier to use and have the features I need. Great to test little JavaScript snippets in IE the same way I do with Firebug in Firefox.

    EDIT 5 years later: I now uses Internet Explorer integrated developer tools.

  • Translate

    IE 8 is supposed to have better tools, but the IE Developer Toolbar is pretty good.

  • Afra Lee

    I use both Microsoft Script Debugger and FireBug Lite, depending on what I am debugging. Both are great tools- try them both out and stich with what you're comfortable with.

  • Translate

    In IE8 just press F12!

  • Translate
    1. Go to Tools->Internet Options…->Advanced->Enable Script Debugging (Internet Explorer)

    then attach Visual Studio Debugger when an error occurs.

    If you're using IE 8, install the developer toolbar because it has a built in debugger.