read a javascript variable from parent into iframe

They have: 426 posts

Joined: Feb 2005

I am generating a random number within a loop and within this loop a create a iframe object that pulls in some dynamic javascript in an HTML page.

The HTML page that is loaded into the iframe needs to read the random number generated in the loop - but I cant figure out the javascript:

This does not work:

parent.document.variableName;

Any help appreciated.

They have: 426 posts

Joined: Feb 2005

Sorry, its more simple than what I thought:

just: parent.variableNAme;

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.