I have an iframe in the jquery UI dialog , setting its src at doument.ready event :
$(document).ready(function() {
$("#iframe").attr("src", whatever);
$("#button").click(function() { $("#dialog").dialog(); });
});
<div id="dialog">
<iframe src="" id="iframe"></iframe>
<div>
Everything is going fine, when i click over the button dialog open but the problem is that it loads iframe content everytime when dialog open.I want to stop this behaviour and load the contents only once at document.ready event.How can i do this?
Use another iframe, hidden, then on dialog open just copy its content to your iframe in the dialog.