开发者

Insert javascript file inside iframe

开发者 https://www.devze.com 2023-01-11 19:59 出处:网络
I\'m trying to do the following: <iframe width=\"300\"> <script type=\"text/javascript\" src=\"file.js\" charset=\"utf开发者_JAVA百科-8\"></script>

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

精彩评论

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