Posts Tagged ‘JSON’

Cross-domain webservice calls using JSONP


The JavaScript class library for SharePoint 2010 enables developers to create rich SharePoint applications using pure JavaScript. If combined with the jQuery library, the power of JavaScript solutions is limitless,….. or isn’t it.

The Same Origin Policy prevents access to resources on other domains. Put simply; you cannot call a webservice from JavaScript that is hosted on another domain. There is however one exception to this claim; browsers allow the <script>-tag to call JavaScript files that are hosted on another domain. The technique JSONP exploits this opportunity.