JSONP
JSONP or "JSON with padding" is a communication technique used in JavaScript programs running in web browsers to request data from a server in a different domain, something prohibited by typical web browsers because of the same-origin policy. JSONP takes advantage of the fact that browsers do not enforce the same-origin policy on
tags. Since it works through
tags, JSONP supports only the GET request method.
<script type="application/javascript" src="http://server.example.com/Users/1234?jsonp=parseResponse"> </script>
In this example, the received payload would be:
parseResponse({"Name": "Foo", "Id": 1234, "Rank": 7});
Comments
Post a Comment