I need to access the i
variable from the loop, in the success function. How do I do that?, can I pass it in to the function?
function save(){
var mods=model.things;
for (i in mods) {
var mod= mods[i];
$.ajax({
url: "duck"
type: "put",
data: JSON.stringify(mod),
success: function(responce_json) {
var j=i;
}
});
}
}