开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜