Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax Cross Domain Calls

Can we make Ajax request to a different instance of server(different port) running on the same machine

like image 839
Rakesh Avatar asked Mar 15 '09 16:03

Rakesh


2 Answers

Different port means different domain for the browser. So you will hit the cross-domain barrier.

Like Stuart said, you could try using JSONP.

If you are using jQuery, I'd recommend http://code.google.com/p/jquery-jsonp/ if you want it to be as painless as possible.

like image 123
Julian Aubourg Avatar answered Sep 29 '22 22:09

Julian Aubourg


With some trickery. Try JSONP.

like image 20
Samantha Branham Avatar answered Sep 29 '22 21:09

Samantha Branham