6

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

Rakesh
  • 5,603
  • 8
  • 33
  • 37

3 Answers3

6

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.

Julian Aubourg
  • 11,206
  • 1
  • 28
  • 28
5

With some trickery. Try JSONP.

Samantha Branham
  • 7,220
  • 2
  • 31
  • 44
0

If you use easyXSS (http://easyxss.net) and follow the example at http://xsslocal.kinsey.no/projects/easyxss/example/methods.html, then you could do this quite easily by having a document on the domain that the xhr-request are hitting doing the real requests.

Sean Kinsey
  • 36,831
  • 7
  • 50
  • 70