Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed part of website

Tags:

iframe

web

embed

I want to embed just this part on my website. How do I do that? I have tried with iframe and it shows me the whole page I just want the table!

enter image description here

like image 522
dzadze Avatar asked Aug 10 '11 21:08

dzadze


2 Answers

If you do know the id of the div the table is in you can do something like this

HTML

<div id="PlaceToPutTable"></div>
<iframe id="iframe" src="urlofpagewithtableonit.html" style="display:hidden;"></iframe>

Javascript

var iframe = document.getElementById("iframe");
var div = document.getElementById("PlaceToPutTable");
div.innerHTML = iframe.contentWindow.document.getElementById("KnowDivName").innerHTML;

Hope this helps.

like image 118
Ash Burlaczenko Avatar answered Sep 19 '22 07:09

Ash Burlaczenko


You can put the part of an external website starting at some id into an iframe, like this. Or you can put an iframe into a div like this.

like image 33
niutech Avatar answered Sep 20 '22 07:09

niutech