JQuery AJAX call throws Access-Control-Allow-Origin Error -
i'm working on project after using $.ajax
make request, receive access-control-allow-origin
error. however, request sent server , response expected xml string.
because of error, success
function never fires, can't read xml response, can see in logs. error
function doesn't reference response string, nor complete
function.
is there way @ response regardless of whether or not ajax request fails? unfortunately don't have access server modify origin restriction, own box.
on response of server have set: access-control-allow-origin: *
be carefull because '*' server able respond without checking crossdomain restriction. if want can put domain make request.
if use php:
<?php header('access-control-allow-origin: *'); ?>
Comments
Post a Comment