开发者

How to close an iframe?

After opening an iframe, I sometimes need to close it. Thus far, I just remove the iframe from its parent node, thus cutting it off from the DOM. However, I'm finding that this doesn't immediately end the iframe's life, and its javascript code can still call back into the parent wi开发者_如何学Gondow, which no longer expects these callbacks.

How can I kill an iframe dead? I don't see a close or destroy method on it.


Create a blank.htm file on your site. Have the IFrame SRC set to the blank.htm, then remove the IFRAME.


if your using jQuery then you can use $.remove('iframe object id') method. This would remove the DOM object from the page and in this iframe would be removed.


try this..

<a href="Home.html" target="_parent">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜