views:

15

answers:

1

I'm trying to do the following:

    <iframe width="300">
      <script type="text/javascript" src="file.js" charset="utf-8"></script>
    </iframe>

But this constructions seems not working. What is the legitimate way to insert javascript file inside iframe using HTML and not calling javascript functions? Is it even possible?

+1  A: 

You cannot add any content directly into an <iframe> tag. Even using JavaScript, you can add content only if the page in the iframe is from the same domain as the parent page.

casablanca