Hi everyone, I have an array with objects, I want to save each one of them via GET, and update certain params in the callback, bot
the html:
<html><body><div id='test'><div id="a">a</div><div id="b">b</div></div></body></html>
the js:
$.map($("#test > div"), save)
save = function(o,i){
itt = $(o)
tmp = {'desc':itt.html()};
$.get('ajax/update_post', {'data':array2json(tmp)}, function(a){
alert(itt.attr('id'))
updatePostBack(a,itt)
})
}
updatePostBack = function(a,item){
alert(item.attr('id'))
}
the updatePostBack is always receiving the las item! how can I pass the right id or object to a callback function in js / jquery?