in my eternal internal fight on whether to stay with mootools or jump to jQuery I\'ve found on the jQuery documentation something that got my attention and this is that jQue
It's said right on the page that it's JSONP.
JSONP is a trick where the server, instead of returning the usual response, wraps it into a method call of the user-supplied method, e.g. instead of:
{"foo": "bar", "baz":"bah"}
It would return:
temporaryCallbackFunctionName({"foo": "bar", "baz":"bah"});
jQuery defines the temporary callback function and inserts a element, which is not limited by the same origin policy.
When the script is loaded, the function is executed and that's it.
The downside is that if the server is evil (or hacked) it can now execute arbitrary code in your browser.
More info here.