Welcome to Gaia! ::

Reply
How to embed external webpage components in your webpage ?

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

ThuckFat

PostPosted: Sat Nov 01, 2008 4:40 am


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:


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]
}