javascript - jQuery AJAX request on local development environment fail -
i'm trying test jquery/javascript script on local development environment. reason script calls error delegate. i've attempted make sure i'm not performing cross-domain request.
$.ajax({ url: 'http://localhost', success: function(data, textstatus, jqxhr) { console.log('success'); console.log(data); }, error: function(jqxhr, textstatus, errorthrown) { console.log(textstatus); console.log(errorthrown); console.log(jqxhr); } }); return marker; }
i'm running wamp stack. here output:
error undefined xmlhttprequest { mozresponsearraybuffer=arraybuffer, status=0, more...}
does know issue?
try replacing absolute url:
url: 'http://localhost'
with relative one:
url: '/'
if doesn't solve problem firebug and/or fiddler give more hints going on , why ajax request fails.
Comments
Post a Comment