Embed for content on my site

0

I have a website where I have quotes, I already have the html structure with the url in the format, www.site.com.br/embed/uiJh but if I supply the code with that url in an iframe, I have to Always specify the correct height size in the iframe, but have quotes that are larger than the others. How can I make the same youtube does? If I put width and height in the iframe, does the content fit the iframe?

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

Does anyone know what I can do?

    
asked by anonymous 30.06.2014 / 21:29

3 answers

1

It seems to me that your idea is to provide content to other sites, so I would use a cross-domain solution.

link

This library uses the window.postMessage method that enables cross domain safely.

Works for browsers above IE8.

link

    
30.06.2014 / 21:42
0

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

Here is an example in jQuery:

$("#minhaDivVLocal").load("minhapaginaexterna.html");
    
30.06.2014 / 21:32
0

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

Your embed can have 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>
    
30.06.2014 / 22:44