Your help would be very much appreciated. I do not understand why the following jQuery code does not work:
function saveChanges(obj, n, id) {
var t = "content to send to server";
$.post("http://localhost:8080/Content.do?method=update",{
value: t,
key: id
},function(result){
alert(result); //WORKS
alert("INNER"+$(obj).parent().parent().html());//WORKS
$(obj).parent().parent().after('<div>dddddd</div>').remove();//FAILS ALL
alert(id); //FAILS
alert("stop"); //FAILS
});
}
My conclusion so far is: inside this callback method function(result)
I do have READ access to the outer object (here $(obj)
) but I do NOT have WRITE access. As soon as I am doing a write the function fails from that point on to the rest of the function.
Is this conclusion correct? If someone knows about a good tutorial who explains this concept I would be greatful. (Object access with jQuery and their scopes...)
thank you very much