Embed for my website content

Asked

Viewed 1,577 times

0

I have a site where I have quotes, I already have the html structure with the url in the format, www.site.com.br/embed/uiJh however, if I provide the code with this url in an iframe, I have to always specify the correct height size in iframe, but there are quotes that are bigger than the others. How can I do the same as youtube does? If I set width and height in iframe, the content falls under iframe?

Because I need to provide only the code of iframe, then the modifications would have to be made on the page of my site.

Does anyone know how I can do?

  • This is gonna be cross-Dopamine?

  • Yes, this embed code will be placed on various websites.

3 answers

1

  • 1

    Ola Marcelo, I will check this link you gave me, it seems that it will work for me, this script I have to put on my page and it seems that it will serve my purpose. Thank you

  • My biggest question in this tool is that the user would have to have iframeResizer.contentWindow.min.js on his site too, but with the embed code there is no way I can make this code available. Would I have to leave this code along with the iframe code for the user to copy? Is there any other way I can do it?

0

Instead of making use of an IFRAME, you can try to dynamically load the rendered HTML from the remote page to an element of the current page.

Here’s an example in jQuery:

$("#minhaDivVLocal").load("minhapaginaexterna.html");
  • Ola Onosendai, in case would need embed because it will be made available on the site, so that users can put the code on their site, in the same thinking of youtube same.

  • @tvieira thank you for the clarification - I understood your question otherwise.

0

A good way to create an embed is through javascript, instead of using iframe and getting stuck to content size.

Your embed can stay with this structure:

<div class="widget">
    <div id="widget-content">Carregando...</div>
    <!-- seu script que carrega o conteudo do link e exiba na div widget-content -->
    <script async src="http://www.site.com.br/embed/script.js" type="text/javascript"></script>
</div>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.