The introduction to this chapter mentioned that a
<script> element can be used as an
Ajax transport mechanism: simply set the
src attribute of a
<script> (and insert it into the
document if it isn’t already there) and the browser will generate an
HTTP request to download the URL you specify.
<script> elements are useful Ajax
transports for one primary reason: they are not subject to the same
origin policy, so you can use them to request data from servers other
than your own. A secondary reason to use
<script> elements is that they
automatically decode (i.e., execute) response bodies that consist of
The technique of using a
<script> element as an Ajax transport ...