我在jQuery用戶界面對話框中的iframe,在doument.ready事件設置它的src:的iFrame在jQuery UI的對話框
$(document).ready(function() {
$("#iframe").attr("src", whatever);
$("#button").click(function() { $("#dialog").dialog(); });
});
<div id="dialog">
<iframe src="" id="iframe"></iframe>
<div>
一切都很好,當我click over the button dialog open
但the problem
是它loads iframe content everytime when dialog open
。 I want to stop
此行爲和load the contents only once at document.ready event
。我該如何做?
我們如何複製內容? – gaurav
'var content = $('#hidden-iframe')。html(); $('#iframe')。html(content);' – slash197
這不起作用 – gaurav