I have two frames: one on the left, which searches for the contents of the fields in another frame on the right. My #matchesFound div created for the dialog is in the search box on the right. However, the javascript that searches and loads the modal is in the left frame. The end result is that the dialog loads in the left frame instead of the right one.
Is there a way to make the jquery UI dialog open in a specific frame? Some of the examples are shaky due to explanations, ajax changes and serialization work just fine.
var criteriaPage = parent.leftSide.document;
var searchPage = parent.rightSide.document;
var postData = $(searchPage ).serialize();
var matchesFound = searchPage.getElementById('matchesFound');
var count =
$.ajax({
type: "POST",
url: "ajax.url.php",
data: postData,
async: false
}).responseText;
$(matchesFound).html(count);
$(matchesFound).dialog({
autoOpen: true,
position: [350,100],
height: 250,
width: 400,
modal: true
});
$(matchesFound).dialog('open');
source
share