Project Note: solutions to memory leakage caused by IFRAME

Source: Internet
Author: User

An iframe is used in the project to process the page before page Jump. during runtime, it is found that the memory of IE increases by about 3 m after the IFRAME is passed and the page is closed. The investigation shows that the IFRAME is not released, thereforeCodeModified:

<Body style = "margin-left: 0px; margin-top: 0px; margin-Right: 0px; margin-bottom: 0px;" onUnload = "winclose ()">
<IFRAME id = "frame1" width = "100%" Height = "100%" frameborder = No marginwidth = 0 marginheight = 0 scrolling = auto allowtransparency = true> </iframe>
<SCRIPT type = "text/JavaScript">
Document. getelementsbytagname ("iframe") [0]. src = Window. dialogarguments ["url_iframe"];
Document. Title = Window. dialogarguments ["modeldialogtitle"]! = NULL? Window. dialogarguments ["modeldialogtitle"]: "";

Function winclose ()
{
OBJ = Document. getelementbyid ("frame1 ");
OBJ. src = "javascript: false ";
OBJ. removenode (true );
OBJ = NULL
Collectgarbage ();
}
</SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.