简体   繁体   中英

Cross Domain Ajax, same server but different port?

I am new to AJAX and trying to learn. I have setup a Java servlet running on port 8983 which returns XML search results from a database when queried. I am also running a wamp server on port 80 and trying to get these search results to show up on the page. I assuming I am encountering this cross domain ajax call problem even though it's the same host, because I'm running these services on 2 separate ports?

I heard the solution is to use jsonp to wrap the response form the servlet in a function. The problem is, I don't think I can do this since this servlet is Apache Solr and I've just configured it and am running it out of the box.

Any suggestions?

根据http://xplus3.net/2010/09/21/solr-and-jsonp/ ,您可以让SOLR接受JSONP请求

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM