0

I a deveveloping a web site that comunicates with a custom made webserver by me in Java. The web site is made in PHP/JavaScript/JQuery running on Apache and i made a simple second webserver in Java to support some designed features by me, and this server runs under another port XXXXX. The problem is, i want to make requests in jQuery to second server the domain is diferent, the page runs on domain and the $.getJSON function calls domain:XXXXX wich is not allowed. I thought user $.getJSONP but im concerning concerned issues. The connections between two points is authed (i was think by passing a token beyond the callback generated by jquery). The two poins are supported by. Is there safe in this case use $.getJSONP or exists other alternatives thinking in browsers support(IE7+ and FF3+).

Sorry for my english :)

Best regards lealoureiro

  • Here is the solution. [Cross Domain Allow][1] [1]: http://stackoverflow.com/questions/5008944/how-to-add-an-access-control-allow-origin-header – Punita Jul 28 '11 at 13:36

1 Answers1

0

JSONP should work for your needs, however your other option would be to have a proxy service on your second server that would make the request server side. Your client-side code could then access all the data natively via json instead of jsonp.

Ben Rowe
  • 28,406
  • 6
  • 55
  • 75