在jQuery中排队

时间:2016-02-23 19:46:48

标签: javascript jquery

$(this).parent().toggleClass('have-submenu-opened');

我必须确定:     $(this).parent().find(".sub-menu").toggleClass("display-on"); 将运行并在之前完成:  func getAvailableCoins() { var coins = [Coin]?() httpClient.getRequest("http://shapeshift.io/getcoins", completion: { data in coins = self.shapeShiftService.availableCoins(data) coinsAreReady(coins) }) } func coinsAreReady(coins: [Coin]?) { //do what you need with your coins here }

1 个答案:

答案 0 :(得分:0)

请参阅JQuery when

$.when(firstFunction)
 .then(secondFunction, myFailure );
相关问题