Visual studio调试器仍然显示从iframe中删除的旧页面。

时间:2022-10-15 20:41:17

I use modal dialogs. A modal dialog is build up with a mask div, and a container div. The container div contains an iFrame with the modal aspx page. When the modal dialog is initialized, the mask and container are added to the page body. When I close the modal dialog, the mask and container are removed from the body.

我使用模态对话框。模态对话框由mask div和container div构建。container div包含一个带有模态aspx页面的iFrame。初始化模态对话框后,将掩码和容器添加到页面主体。当我关闭模态对话框时,蒙版和容器将从主体中移除。

Everything works fine, and when I start debugging in Visual Studio, and open a new modal dialog, I see the new page in the debugger at 'script documents - Windows Internet Explorer - somePage.aspx'

一切正常,当我在Visual Studio中开始调试,打开一个新的模态对话框时,我在“脚本文件- Windows Internet Explorer - somePage.aspx”中看到调试器中的新页面。

But when I close and remove the dialog, the page just stays 'alive' in the VS debugger, until I refresh the complete page.

但是当我关闭并删除对话框时,页面在VS调试器中保持“活着”,直到我刷新整个页面。

Is this bad? Does the page 'stay alive' somewhere even tho its removed from the body? Or is it just a Visual Studio debugger UI thingy?

这是坏的吗?这一页即使从身体上去掉了,它还能在什么地方“活下去”吗?或者它只是一个Visual Studio调试器UI thingy?

I found this question, about endlessly growing script block files. I think thats the same issue, but that question is not really answered there.

我发现了这个问题,关于不断增加脚本块文件的问题。我认为这是同一个问题,但这个问题并没有得到真正的回答。

1 个解决方案

#1


2  

It is not enough to remove the container div that contains the iframe.

仅仅删除包含iframe的容器div是不够的。

I expected that this would be sufficient to remove and destroy the iframe:

我希望这足以消除和破坏iframe:

$(this.mask).remove();
$(this.container).remove();

The container contains one other div (the modal dialog title) and an iframe. That iframe is not removed by killing the container using the above code. It looks like its not just a Visual Studio debugger issue, because the memory of the iexplore.exe process in windows task manager is also going up, and up, and up, every time I close and open a new dialog.

Solution: When I explicitly remove the iframe, then the page does disapear from the debugger!

容器包含另一个div(模态对话框标题)和一个iframe。使用上述代码杀死容器不会删除iframe。它看起来不只是一个Visual Studio调试器问题,因为iexplore的内存。每次我关闭并打开一个新的对话框时,windows任务管理器中的exe进程也会向上、向上、向上。解决方案:当我显式地删除iframe时,页面会从调试器中删除!

I can do that by saving the the iframe in a var on initializing the modal dialog, and then explicity remove the iframe when removing the modal dialog. This way:

我可以在初始化模态对话框时将iframe保存在var中,然后在删除模态对话框时将iframe删除。这种方式:

on create / initialize modal dialog:

关于创建/初始模式对话框:

this.frame = this.container.childNodes[0].childNodes[1];

and on close modal dialog:

在关闭模式对话框:

$(this.frame).remove();

#1


2  

It is not enough to remove the container div that contains the iframe.

仅仅删除包含iframe的容器div是不够的。

I expected that this would be sufficient to remove and destroy the iframe:

我希望这足以消除和破坏iframe:

$(this.mask).remove();
$(this.container).remove();

The container contains one other div (the modal dialog title) and an iframe. That iframe is not removed by killing the container using the above code. It looks like its not just a Visual Studio debugger issue, because the memory of the iexplore.exe process in windows task manager is also going up, and up, and up, every time I close and open a new dialog.

Solution: When I explicitly remove the iframe, then the page does disapear from the debugger!

容器包含另一个div(模态对话框标题)和一个iframe。使用上述代码杀死容器不会删除iframe。它看起来不只是一个Visual Studio调试器问题,因为iexplore的内存。每次我关闭并打开一个新的对话框时,windows任务管理器中的exe进程也会向上、向上、向上。解决方案:当我显式地删除iframe时,页面会从调试器中删除!

I can do that by saving the the iframe in a var on initializing the modal dialog, and then explicity remove the iframe when removing the modal dialog. This way:

我可以在初始化模态对话框时将iframe保存在var中,然后在删除模态对话框时将iframe删除。这种方式:

on create / initialize modal dialog:

关于创建/初始模式对话框:

this.frame = this.container.childNodes[0].childNodes[1];

and on close modal dialog:

在关闭模式对话框:

$(this.frame).remove();