jQuery.getScript: data variable in callback undefined

Posted by Hannes on Stack Overflow See other posts from Stack Overflow or by Hannes
Published on 2009-07-08T07:54:26Z Indexed on 2010/05/06 5:08 UTC
Read the original article Hit count: 420

Filed under:
|

I'm trying to load an external JavaScript using jQuery's getScript(), like this:

$.getScript("http://api.recaptcha.net/js/recaptcha_ajax.js", function(data) {
	window.alert(data);
});

but as the alert window shows, the data variable in the callback function is undefined, unlike promised in http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback.

Anyone know why this might be?

Thanks.

© Stack Overflow or respective owner

Related posts about jquery-ajax

Related posts about jQuery