can anybody help me create an embed code for my users? [duplicate]

心不动则不痛 提交于 2019-12-13 09:54:06

问题


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


回答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




回答2:


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>


来源:https://stackoverflow.com/questions/19260103/can-anybody-help-me-create-an-embed-code-for-my-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!