tags:

views:

135

answers:

3

Im trying to use jquery to make an ajax on a specif port

$(document).ready(function() {
  $.ajax({
  url: "http://test_serve:666/test.php",

  type: "GET",
  data: ({value_test: 'true'}),
  dataType: "html"

 });
})

And this does not work, no ajax call is made nor do I get any exception (using firebug) It does work if I do not specif the port. Anyone know why? Thanks!

A: 

is the webpage you use that is on the same port ?

If not you would run into the same origin policy and it won't work.

RageZ
+1  A: 

It doesn't works due the Same origin policy, Ajax request are allowed only in the same domain, protocol and port.

If you really need to get data from that source, you should look forward to JSONP.

CMS
thank you, it looks JSONP will provide the answer!
null_radix
A: 

Cross-Site Scripting?

NTulip
@Ntulip: XSS? would you be a bit longer on the answer.
RageZ
@RageZ: "Same Origin Policy" where 1 of the 2 channels is not on the same domain. @CMS his answer is what I was referring to.
NTulip