简体   繁体   中英

<script type=“text/javascript”> into iframe?

All the Questions I find are more complex than this!

A site generates this code for adding social share buttons on my site:

<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57a28ab5d5f31c04"></script>

It has to be pasted in HTML inside <body></body>

But my web constructor online only allows me to insert a tag: <iframe></iframe>

I understand the basic embedding purpose of an iframe but is there a way to make that script work into the iframe?

Thanks for your help!

Pretty sure it depends on what that script links to or contains references to.

I'm not sure an iframe would be all that nice to use but it should be doable. Though you might have to create a separate page with that source and then link it via iframe.

e.g. <iframe src="link to page with that source code eg http://www.example.com/sharebuttons.html"></iframe> 

Edit: It's pure js so you'll want to use a script tag in the body of your doccument as is provided or you'll have to do so on another page and use an iframe to link that page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM