0

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

2 Answers2

1

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

Community
  • 1
  • 1
Jay Huang
  • 356
  • 1
  • 10
  • hey thats awesome for example like DISQUS how they allow you to embed the comment widget i want to be able to share mine that way? –  Apr 10 '20 at 00:09
0

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>
StackSlave
  • 10,613
  • 2
  • 18
  • 35
  • Yes from sites I've seen that do this the embed code is normally a just a few lines long with their url included and a link if you go and have a look like facebook also do it with there like buttons and comment boxes –  Oct 09 '13 at 08:05