0

I am building an application using WorldBank API, but WorldBank API does not support JSONP. So is there a way to parse remote JSON using Javascript. Thank You

2 Answers 2

2

Due to the same origin policy restriction you cannot send direct AJAX calls to different domains. You may take a look at the following guide for different solutions. Since JSONP is out of the equation for you, an alternative would be to use a server side script that will act as a bridge between your domain and the distant domain.

Sign up to request clarification or add additional context in comments.

2 Comments

Hello Thanks for responding, Will creating a proxy affect performance of the application??
@NeoStar, this will depend on how you implement it but in all cases there will be a performance penalty due to the additional requests.
1

You can create kind of proxy. If using php, U can consume JSON in php script, and then serve it in your domain (where js works)

Cannot send direct AJAX to different domain because of Same Origin Policy.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.