views:

29

answers:

1

I'm calling a dialog that says "Please wait while the page is loading.." from differnt functions. The dialog opens up fine when called one function(working function) but doesn't open when called from other functions(clearAll) on the same page. The other function executes fine but just the dialog doesn't appear. Any ideas whats going wrong ? Thanks

$(document).ready(function() {
...................
$("#waitDialog").dialog({autoOpen: false, modal: true, width: 500, maxWidth: 500, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar").hide(); } });

});

.....
function clearAll(){
$("#waitDialog").dialog('open');
......... ....ajax call..
$("#waitDialog").dialog('close');
}

function working(){
$("#waitDialog").dialog('open');
... ajax call...
sub_working();
}

function sub_working(){
...
$("#waitDialog").dialog('close');
}

.................

//removed the tags at the begining and ending of div tags intentionally here ..
div id="waitDialog" style="display:none;background-color:blue;">

Please wait while the page is loading..

/div>

A: 

I could be way off but I just wonder if you try removing the close method so quickly after if you now see it. It might have to do with the time to make the ajax call. Maybe the other method is so quick that you don't get a chance to see it?

Can we see the AJAX calls? Maybe there is also a JS error happening in the one you think is working and instead it is just breaking the code and that is why it appears to work is because it doesn't move on to the next step.

I could be way off but I don't see much that would be calling a problem?

spinon