Why call iframe from javascript

Posted by sammville on Stack Overflow See other posts from Stack Overflow or by sammville
Published on 2010-12-23T22:46:59Z Indexed on 2010/12/23 22:53 UTC
Read the original article Hit count: 177

Filed under:
|

I want to know why some ad codes or embed codes don't directly give you iframe code to embed on your site instead they give a javascript code which links to another javascript file on their server. The file on their server calls the iframe which serves the content. Why is this done and what are the benefits of this method.

Example: this is the code issued by amazon:

<script type="text/javascript" src="http://www.assoc-amazon.co.uk/s/ads.js"></script>

Which opens another javascript file that calls the iframe.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about iframe