Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iframe scripting

Status
Not open for further replies.

DaZZleD

Programmer
Oct 21, 2003
886
US
Hi,


I have a document that contains an Iframe. I would like to call from this document a function found inside the IFrame. In IE this works easily with document.frames[0].functionName(). But the problem is to make this work in Mozilla. Anyone has any suggestions?

Thank you

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Check out a post I made back in March (the search function really is underused): thread216-1021687

It shows how to access the document inside the iframe, and so can easily be modified to run functions within the iframe.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
>[tt]document.frames[0].functionName()[/tt]
[tt][red]window[/red].frames[0].functionName()[/tt]
 
tsuji, that would work in IE, what about Mozilla?


i have managed to make this work by declaring the functions and variables I need as belonging to the document IE:

document.myFunction = function () {...}

and then calling this by accessing the document in the iframe.

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
I posted it because it is cross-browser. Is it not, DaZZleD? I had a simple test page to back me up. Maybe that was too simple a test page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top