开发者

jQueryUI tab problem

开发者 https://www.devze.com 2023-01-12 12:09 出处:网络
For some weird reason, the event \"load\"开发者_Go百科 and even the option \"success\" from ajaxOptions got sort of a problem (or feature).

For some weird reason, the event "load"开发者_Go百科 and even the option "success" from ajaxOptions got sort of a problem (or feature).

When I click on a tab, while the tab load the content thru AJAX I wanted to pop up an dialog, and when it's DEFFINITLY done, to close the dialog.

I dont know why but, the dialog is closing as soon as the ajax find out that the page exists...that kinda suck when it take a while for your page to load.

Heres my code:

    $("#tabs").tabs({
  select: $('#dialogLoadingData').dialog('open'),
  ajaxOptions: {
    success: function() {
      $('#dialogLoadingData').dialog('close')
    }
 }
});


You need an anoymous function there, like this:

$("#tabs").tabs({
  select: $('#dialogLoadingData').dialog('open'),
  ajaxOptions: {
    success: function() {
      $('#dialogLoadingData').dialog('close')
    }
 }
});

Also, as @Fosco noted in comments, success also needs a typo fix.

0

精彩评论

暂无评论...
验证码 换一张
取 消