Created
February 7, 2016 14:45
-
-
Save Torokun/283c7c51af6330c3ac6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 処理A(Ajax)して処理B(Ajax)して処理C(Ajax)して、その後に処理Dをする | |
$(function(){ | |
var _resultA = null; | |
var _resultB = null; | |
var _resultC = null; | |
function processA() { | |
// Aの処理(Ajax呼び出し) | |
$.get(url1, dataA, function(data, textStatus, jqXHRn){ | |
// なんか処理して次の処理を呼ぶ | |
_resultA = hogehoge; | |
processB(); | |
}); | |
} | |
function processB() { | |
// Bの処理(Ajax呼び出し) | |
$.get(url2, dataB, function(data, textStatus, jqXHRn){ | |
// なんか処理して次の処理を呼ぶ | |
_resultB = hogehoge; | |
processC(); | |
}); | |
} | |
function processC() { | |
// Aの処理(Ajax呼び出し) | |
$.get(url3, dataC, function(data, textStatus, jqXHRn){ | |
// なんか処理して次の処理を呼ぶ | |
_resultC = hogehoge; | |
processD(); | |
}); | |
} | |
function processD() { | |
// Dする | |
someProcess(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment