Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On page 'www.foo.com', can a script loaded from 'www.example.com' send ajax requests to 'www.example.com'?

Is this something restricted by cross-origin policy or not?

like image 477
Uzair Farooq Avatar asked Aug 02 '12 08:08

Uzair Farooq


2 Answers

You can't. You could only sent requests to www.foo.com.

like image 200
xdazz Avatar answered Oct 22 '22 22:10

xdazz


No. The page is the origin, not the script.

The page is on www.foo.com. The script is loaded from www.example.com. XHR requests can be made to www.foo.com but not www.example.com.

like image 28
Quentin Avatar answered Oct 22 '22 22:10

Quentin