开发者

How to put an iframe/div next/before the <script> block?

How to put the iframe/div using javascript next/before the <script> block, just like google ads. So I am putting a script tag in an html and I want an iframe to appear at the same location in the rendered HTML.

<script>
    // do something to add an iframe/div so that it appears on pag开发者_如何学JAVAe 
    // as if it were added in place of script
<script>


Use document write:

document.write('<iframe src="url"></iframe>');
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜