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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code not returning value from iFrame to parent page 1

Status
Not open for further replies.

NeeNee

Programmer
Apr 2, 2002
97
CA
I am using an iFrame to look up a course name and display the value in the parent page using Javascript.

document.parent.frmCancellation.txtCourseName.value = 'CUISINE A LA CARTE 2';

Now this code works great in IE but I get the following error from the Firefox Error console;
Warning: reference to undefined property document.parent

I suspect this error is due to the difference in the DOM between IE and FF, but I can't find explicit documentation telling me how to place values on a parent page.

Any help would be appreciated.


Denis
Programmer, Canada
 
Thanks Adam,

I had tried document.parent but not parent.document.

Do you know where I can find explicit comparisons between FF and IE?

Denis

Denis
Programmer, Canada
 
If you mean reference material that shows DOM methods for one browser with the matching methods in a different browser, then I'd say you're looking for the wrong thing.

Adam's syntax should work cross-browser, as it's pretty standard. It just so happens that your original syntax was wrong, not browser-specific. Just because it happened to work in IE doesn't make it right :)

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks Dan,

Where is a good site where I could learn more about DOM methods and syntax. I am new to javascript.


Denis
Programmer, Canada
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top