Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In short, all AJAX requests (and cross-window scripting) are subject to the <a href="http://en.wikipedia.org/wiki/Same_origin_policy" rel="nofollow noreferrer">Same Origin Policy</a>. JSONP (<a href="http://en.wikipedia.org/wiki/JSON#JSONP" rel="nofollow noreferrer">JSON with Padding</a>) isn't subject to the Same Origin Policy because it involves adding a script from an external domain to the DOM, the script itself contains a call to a known function that already exists on the client, with the JSON as the function call's argument. </p> <p>JSONP can't return HTML or XML directly, but it could pass an object that contains a string of HTML or XML data, which in turn could be added to the DOM or parsed by the client.</p> <p>For instance, a JSONP might return:</p> <pre><code>jsonp_callback({"Errors":"none","Data":"&lt;div id='externalWidget'&gt;Hello!&lt;/div&gt;"}); </code></pre> <p>When this script is added to the page, the function <code>jsonp_callback</code> will be executed with the JSON object as its argument. That function would then add the HTML code to the page. </p> <p>There are other ways of achieving what you want. For instance, if the client doesn't need to manipulate the data in any way, you could provide a widget via a HTML document that would be iframed by your client's page:</p> <pre><code>&lt;iframe id="widget" src="http://mysite.com/widget/v1/" /&gt; </code></pre> <p>If they did need to manipulate the data, they would blocked by the Same Origin Policy as outlined above.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload