开发者

delete html, jQuery

开发者 https://www.devze.com 2023-01-16 12:17 出处:网络
have a look at this example link text It creates a开发者_运维百科 dialog with a iframe init that loads an external page.

have a look at this example link text It creates a开发者_运维百科 dialog with a iframe init that loads an external page. The dialog is added to the DOM. Is it possible to delete it on dialog close event?


In the close event of the dialog you can .remove() it, for example:

$('<iframe src="' + this.href + '" />').dialog({
  //...current options...
  close: function() {
    $(this).dialog('destroy').remove();
  }
});

This removes the <iframe> and it's contents as well as destroying the actual dialog widget around it which is no longer useful.


yes, if i understand you corectly you can remove() iframe from the DOM

put with code in the close event

$("#divContainerWithiFrame").remove("iframe");

http://api.jquery.com/remove/

0

精彩评论

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