Now I use this function to load content from another page in the jquery ui dialog:
function openDialogByUri(div, uri, title, width, height, buttonsArray) {
div.load(uri, function() {
div.dialog({
title: title,
width: width,
height: height,
position: 'middle',
resizable: false,
buttons: buttonsArray
});
});
}
For example, for example:
$('a.dictionary').click(function() {
openDialogByUri($otherDialogContainer, '/test.php', 'Dialog title', 600, 400,
{
'Close': function() {
$otherDialogContainer.dialog('close');
}
}
);
return false;
});
The problem is that it may take some time before loading content from an external page. Until this happens, the dialog will not appear, and it seems that nothing is happening to the users.
How can I change this function to work as follows:
When the user clicks on the link that calls the function above, the dialog opens immediately. Inside the dialog box there are several loading bars or similar images that indicate that the contour is loading. After loading the content, paste it inside the dialog box.