I am using remote URL to call web service which posts data to remote URL and returns a JSON response contains data and I have used jsonp for requesting the JSON data because AJAX doesn’t support
cross domain calls by default because of security reasons.
JSONP is the light weight method to request data from a server to a different domain.JSONP is useful for cross domain issue and calls remote/external URL request.
Let’s view following code:
Problem & solution:
Here I have pass dataType as jsonp and important is to pass
&callback= into url otherwise your code will not work.you will not get proper response.If &callback is missing, you will get
parse error or error
status = 0.
It’s a wrap!.This is the today’s quick tip! I’m hoping that you’ve found this technique useful.