Frodik
Frodik

Reputation: 15455

How to allow cross-domain requests in Safari?

I have webapp I run from localhost (because of debugging) and it makes cross-domain AJAX requests. I can easily set flag for Chrome "--disable-web-security" and the webapp works as expected in Chrome. But I need to do this for Safari on Windows as well. Is there some similar flag or can I set this in Preferences somewhere ?

Thanks for help.

Upvotes: 1

Views: 6752

Answers (1)

Frodik
Frodik

Reputation: 15455

Solution is to set a header Access-Control-Allow-Origin: * on the server.

In PHP it's easy like this:

header("Access-Control-Allow-Origin: *");

Credit for the answer goes to Brain2000, thanks for suggesting a link in your comment.

Upvotes: 3

Related Questions