Skip to content

Instantly share code, notes, and snippets.

@maimai-swap
Created April 23, 2016 07:07
Show Gist options
  • Save maimai-swap/fd8be3d41b9a454251cbf6ca61b1269b to your computer and use it in GitHub Desktop.
Save maimai-swap/fd8be3d41b9a454251cbf6ca61b1269b to your computer and use it in GitHub Desktop.
nazo.js
// これがうまく行って
$.each(reserve_ids,function(index,elem) {
$.ajax({
type: "GET",
url: "execute.php",
success: function(data){
// いろいろ
},
error: function(data) {
// いろいろ
}
}).done(function(){return true;});
}
// これがうまく行かない。
var speed = 1000;
$.each(reserve_ids,function(index,elem) {
setTimeout(
$.ajax({
type: "GET",
url: "execute.php",
cache: false,
timeout: 20000,
success: function(data){
// いろいろ
},
error: function(data) {
// いろいろ
}
}),index*speed);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment