Is it possible to specify port in ajax call

I am trying to use jQuery to run an AJAX request on a specific port:

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

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

    });
})

This does not work: no AJAX call is made, and I get no exceptions in Firebug. It works if I do not specify a port. Does anyone know why?

+5
source share
2 answers

This does not work due to the same rule of origin . AJAX requests are allowed only in the same domain, protocol, and port.

If you really need to get data from this source, you should expect JSONP.

+7
source

- Is the webpage you are using on the same port?

, .

+1

All Articles