I have this piece of code to open up a JQuery dialog with specific controls according to 2 links. Now it works fine on the 1st attempt. But the 2nd time when I click the link to load the JQuery dialog, it opens a blank dialog. On closing it and clicking the link again it opens the right dialog. On repeated trials it throws me an error in the JQuery 1.3.2.js file.
Code given below:
$('#div1').dialog("destroy");
if (criteria1== "L") {
$("#div1").html("<iframe id='dialogFrame1' src='../WebPages/abc.aspx'
Height='100%' Width='100%' frameborder='0'></iframe>");
}
else {
$("#div1").html("<iframe id='dialogFrame2' src='../WebPages/abc1.aspx'
Height='100%' Width='100%' frameborder='0'></iframe>");
}
$('#div1').dialog(
{
height: 220,
title: "Title",
width: 500,
modal: true,
beforeclose: function (event, ui) {
$("#div1").html("");
$("#div1")[0].innerHTML = "";
}
});
$('#div1').parent().appendTo($("form:first"));
$('#div1').dialog('open');
Am i using the wrong JQuery file? Any views on how to fix this issue?