I discovered to have some problem to fully understand callbacks scoping when trying to learn Jquery. I would add that i have little experience with the Javascript language The code:
var globDom; // placeholder for DOM fragment
// Getting xml file; jquery parses the file and give me back a DOM fragment
// saveXML is the callback
$.get(requestTarget, {}, saveXML);
// the globDom here is UNDEFINED !
alert(globDom);
// the callback
function saveXML(xmlDom)
{
globDom = xmlDom;
}
I am sure that here there is a BIG misunderstanding by me ...
Have any suggestion?
Thanks
Daniel