2 ms·
<script> tags aren't subject to cross-domain restrictions. Think about it - all those website statistics scripts are hosted on external servers, but their Javas
by feross 16y ago
<script> tags aren't subject to cross-domain restrictions. Think about it - all those website statistics scripts are hosted on external servers, but their Javascript gets executed just fine. By dynamically inserting <script> tags into the page, you can force Javascript from another domain to execute in your domain.
- shajith 16y agoGot it, thanks. I finally got around to learning JSONP. JQuery's $.ajax API handles it automatically for you too (if you use the 'jsonp' or 'script' dataType options), which is very nice.