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

调试IE中的一个模态对话框(showModalDialog)-Debugamodaldialog(showModalDialog)inIE

Iwanttodebug(examineDOM,usetheinteractiveJSconsole,etc)partofawebapplicationthatis

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().

我想调试(检查DOM、使用交互式JS控制台等)web应用程序的一部分,该部分位于由showModalDialog()创建的模态对话框中。

I can't find a way to use the standard IE-8 developer tools for this; The dialog doesn't have a toolbar and the usual shortcut (F12) doesn't work.

我找不到一种方法来使用标准的IE-8开发工具;对话框没有工具栏,通常的快捷方式(F12)不起作用。


Another SO question (I unfortunately have lost the link to) suggested that the only solution is to (perhaps temporarily) replace showModalDialog() with an old-fashioned window.open(). If this is the case, is there a straightfoward way to do it?

另一个SO问题(我不幸丢失了链接)建议,惟一的解决方案是(可能是暂时的)用老式的windows .open()替换showModalDialog()。如果是这样的话,有什么简单的办法吗?

Caveats:

警告:

  • The app cares about passing dialogArguments and the return value of showModalDialog
  • 这个应用程序关心的是传递对话框和showModalDialog的返回值。
  • I can't use other browsers, FF+Firebug, etc.
  • 我不能使用其他浏览器,FF+Firebug等等。

4 个解决方案

#1


61  

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

如果打开地址栏,F12可以打开开发人员工具。

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

来源:https://stackoverflow.com/a/10984858/79835

#2


7  

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.

我在js代码中创建了一个错误,然后弹出错误窗口询问是否要调试脚本。

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

一种方法是调用代码中某个不存在的方法。

e.g. blabla();

例如鼓励性产业();

#3


2  

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.
  • 您可以在您的js代码中包含指令调试器;这将停止js执行,就像您放置了断点一样。
  • 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.
  • 您还可以在打开模态窗口之前打开ie developer工具,打开后,您可以在script选项卡中查看生成的代码,添加断点,暂停执行,……你需要的一切。

Hope it helps!

希望它可以帮助!

#4


2  

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

现在,您可以在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.

IE和Chrome都应该在它上崩溃,就像你设置了断点一样。确保它自己在一条线上。按F12打开浏览器调试器,然后刷新页面或触发事件来运行Javascript,调试器应该自动显示带有断点集的代码。


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