1.

Solve : How to embed external webpage components in your webpage ??

Answer»

Hello everybody.

Situation:
Me and a few others are supposed to setup a team home page for our local soccer team.
Problem:
To make life easier and to keep us automatically up to date I'd like to embed a few tables from another page - Fussball.de to be specific, cuz they get up to date information from ALL teams in Germany

Here's an example:
This page has the table of "Altliga Ü60 Kreisklassen A" league. I'd like to somehow embed it in our webpage.


Question:
How do I embed the table (or any other component) from the external webpage into our webpage ?
-------------------------------------------------------------------------------

Here's how I wanted to do it (Doesn't work):
Idea:
1.) Load the external webpage in an iframe
2.) Get the webpage contents with with javascript
3.) Localize the component and save it as a variable
4.) Change the iframe according to the size of the component


The code:
Code: [SELECT]<html>
<head>
<script type="text/javascript">
function TEST()
{
//List of iframes in the current document
var iFrames = document.getElementsByTagName("iframe")
//the desired Frame
var theFrame = iFrames[0]
//Frame document
//°°°°°°°°°°°°°°°°!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!°°°°°°°°°°°°°°°°°°°°°°°°
//This suddenly doesn't work :( even though the page is loaded in the 'iframe' tag
//°°°°°°°°°°°°°°°°!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!°°°°°°°°°°°°°°°°°°°°°°°°
var frameDocument = aFrame.contentDocument
//All tables of the frameDocument
var tables = frameDocument.getElementsByTagName("table")
//Because there's only one I try to initialize a variable with it
var table = table[0]
}
</script>
</head>
<body>
<button ONCLICK="test()">This is a button</button>
<iframe src="http://www.fussball.de/fussball/servlet/content/86?next=%2F0809%2F013%2F062%2F021%2F632130&tag=50001" width="100%">
</body>
</html>
Help's greatly appreciated



Discussion

No Comment Found