iframe page find the iframe ID

They have: 426 posts

Joined: Feb 2005

So I am using Iframes.

What I need to do is the HTML page or script that is loaded into the iframe needs to detect the iframes ID.

I will have a number of iframes on the parent window and each iframe will have a generated id when it is printed on the page but the script template that is loaded into the iframe needs to know the ID of the iframe it is loaded into.

Does anyone know how I could do this?

I have tried passing a parametre into the url of a php page but this doesnt seem to work? Or I could be doing this incorrectly.

Really I want to beable to detect the ID of the iframe it is being loaded into that way I am not reliant on the parametre?

Any suggestions welcome.

They have: 426 posts

Joined: Feb 2005

Ok so I have just discovered the world of cross site scripting! Yes I have a page loading into the iframe from a different URL which is not allowing me to alter the iframe dimensions.

I suppose there is no way around it? Can anyone think of any way I can alter a iframe dimentions from within a iframe which page is loaded from a different domain?

Can I simulate the effects of a iframe with a div? I have a page template basically that I want to implement into a few iframes on a page. Can you make a div act like a iframe?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.