jQuery getScript not running fail method on connection refused -
i'm trying account script not loading might blocked china's firewall. edited hosts file direct google.com , www.google.com 127.0.0.1.
when run following
$.getscript('https://www.google.com/recaptcha/api.js').done(function(){ console.log('done'); }).fail(function(){ console.log('fail'); });
i done
when not blocked don't fail
when blocked. see connection refused in console when trying load script.
am missing in documentation? how can test or run fallback if script fails load. why fail not firing? i've tried manner of stuff work can't figure out.
i tried writing long hand no avail well.
$.ajax({ url: "https://www.google.com/recaptcha/api.js", datatype: 'script', error: function(){ console.log('test'); }, cache: false, complete: function(){ console.log('complete'); }, success: function(){ console.log('success'); } });
am missing in docs?
yes. note in error
description:
note: handler not called cross-domain script , cross-domain jsonp requests.