+2  A: 

A different port on the same website still violates the XHR Cross domain policy. The only way it could work cross-domain is either JSONP (does not support POST requests) or a proxy webservice on the same server.

JSONP is the easiest, what it does is basically just add a <script> tag to your <head> to the url, which would perform a GET request (so bye bye postdata). And you can make it call a javascript callback by adding a "callback=?" GET parameter to the url - the response would then have to call the javascript method named in the 'callback' parameter. If that makes sense..

jQuery is probably detecting that it is a remote URL and tries to use JSONP, but because there are no callbacks made it fails (and error does not get called either).

CharlesLeaf
If I use JSONP, what's the difference from the server program's standpoint? Can I still use the same HTTP headers, or is there funky JSONP formatting going on?
For the server it shouldn't matter, except that you have to receive all the data via GET instead of POST. And add the callback=? (with the question mark, jQuery will replace it) to the url, then on the server you only have to wrap your JSON response inside the name in callback. For example if jQuery sends callback=myFunc then you respond with myFunc({yourjsonobject}); (and send the right Content-Type header for javascript)
CharlesLeaf
CharlesLeaf
I also see you just posted your headers, perfect example as you can see jQuery is already performing a GET request with the parameters appended to the querystring.
CharlesLeaf
Good catch. I had this same issue trying to connect to tomcat from apache.
Stefan Kendall
Working like a charm! Thanks a lot, man.