简体   繁体   中英

Ajax calls makes Cross Domain trouble in Magento while using REST calls

I am able to render json data in browser but when giving it as URL link in javascript, It doesn't brings the data.

It shows null. The same thing happened when i use java. I think this is the cross domain problem.

How to get resolve of this??

Use CURL to get the Data's from Cross Domaim. Curl is more reliable and best method for cross domain data obtain.

You could try to used jsonp. See Basic example of using .ajax() with JSONP?

You could also create a proxy, a simple php script on your web server that get the info from the remote server. See http://benalman.com/code/projects/php-simple-proxy/examples/simple/

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