Debug a modal dialog (showModalDialog) in IE

前端 未结 4 1777
死守一世寂寞
死守一世寂寞 2021-02-03 19:48

I want to debug (examine DOM, use the interactive JS console, etc) part of a web application that is inside a modal dialog that was created by showModalDialog().

相关标签:
4条回答
  • 2021-02-03 20:21

    i do it by creating an error in the js code, which then brings up the error window asking if you want to debug the script.

    one way to do that would be to call a non-existent method somewhere in the code.

    e.g. blabla();

    0 讨论(0)
  • 2021-02-03 20:36

    F12 works to bring up the developer tools if you turn the address bar on.

    Go Tools / Internet options / Security / (pick the right zone for your site) / Custom Level Under "Miscellaneous" Under "Allow websites to open windows without address or status bars", choose "Disable".

    Source: https://stackoverflow.com/a/10984858/79835

    0 讨论(0)
  • 2021-02-03 20:37

    What I do when i'm debugging modal windows are two things.

    • You can include in your js code the instruction debugger; that will stop the js execution as if you had put a breakpoint.
    • You can also open the ie developer tools before opening the modal window and, once it's open, you can review the generated code in the script tab, adding breakpoints, pausing execution,... everything you need.

    Hope it helps!

    0 讨论(0)
  • 2021-02-03 20:41

    You can now put the word debugger without quotes in your javascript.

    IE and Chrome should both break on it as if you had set a breakpoint on it. Make sure its on a line by itself. Press F12 to open the browser debugger and then refresh your page or trigger the event to run your javascript and the debugger should automatically display the code with the breakpoint set.

    0 讨论(0)
提交回复
热议问题