This question already has an answer here:
-
How to create embed code for other sites
2 answers
-
How to create an Embed Code for my users? [closed]
Hello can anyone help me with an embed question? I need to know what code I use to allow users to use on thier own websites, kinda like disqus and other websites were there is an embed code and it just prompts you to copy and paste it How can I do this for my slider tool so users can use it on there own websites
Here's some sample code from a similar question asked in the past:
<script type='text/javascript' charset='utf-8'>
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.src = 'URL OF CONTENT YOU WANT TO PROVIDE';
iframe.width = 'THE WIDTH YOU WANT';
iframe.height = 'THE HEIGHT YOU WANT';
</script>
More info here: https://stackoverflow.com/a/14099243/1905554
If you mean to use your JavaScript code on their website use then:
<script type='text/javascript' src='absolutePathwhereTheyGetYourCode'></script>
Just have them copy and paste the code right before the </body>
closing tag, like:
<script type='text/javascript' src='absolutePathwhereTheyGetYourCode'></script>
<script type='text/javascript'>
// now they can use your code here
</script>
</body>