[jQuery] $.getScript callback doesn't work as expected
The docs say:
Callback
A function to be executed whenever the data is loaded successfully.
function (data, textStatus) {
// data should be javascript
this; // the options for this ajax request
}
however if I do
$.getScript(url, function(data){console.log(data);})
it prints null. The script is loaded fine.
I'm trying to load the script and assign the source to an object,
should I avoid this function altogether and use eval() and a GET?