Insert javascript file inside iframe
I'm trying to do the following:
<iframe width="300">
<script type="text/javascript" src="file.js" charset="utf开发者_JAVA百科-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?
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.
精彩评论