English 中文(简体)
我如何利用j Query格来拖延行动,直到非洲复兴开发银行的一系列活动结束为止?
原标题:How do I use jQuery queue to delay action until series of AJAX events have completed?
  • 时间:2010-12-21 19:42:11
  •  标签:
  • jquery

我有以下法典,以动态方式建立:

$j("#id").load( create_menu.cgi ,  view=select_menu );

同一菜单在页数的多个部分使用,因此,我会发出要求,以制造_menu.cgi,我想复制从首个点到需要菜单的网页上的其他地点。

我过去曾用过问答,认为我可以在这里使用。 然而,似乎就象本案中的提问那样,在统一法(reate_menu.cgi)被称作不一定是在实地出现后。 举例来说,以下工作并不奏效:

$j("#id").load( create_menu.cgi ,  view=select_menu ).queue(function(){

  doSomething();
  $j(this).dequeue;

});

doSomething(Something)没有等到男子实际到那里。 是否有办法对类似情况进行点调查,这样,在创建第一个单元之后,就立即将菜单复制到该页的另一部分?

最佳回答

相反,你可以使用<代码><>/代码>功能的第三个参数;<代码>complete呼应。

load(url, [ data ], [ full(responseText, textStatus, XMLHttpRequest]

因此,就你而言,情况就是如此:

$j("#id").load( create_menu.cgi ,  view=select_menu , doSomething);

Documentation。

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...