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

Writing to frame document errors

Status
Not open for further replies.

waytech2003

Programmer
Jul 14, 2003
316
US
I have a webpage that contain frames. Left sided (Frame1) has menu buttons, right side (Frame2) is where the action occurs.

I use Javascript functions that are stored in Frame1, to manipulate Frame2's content. Several of my functions involve writing messages to the right frame document.

Example:
top.Frame2.document.write("<p align='center'><b>Loading Billing Form. Please Wait.</b></p>");

This is working well except when I have previously loaded a jpeg picture into the Frame2, and then try to write() a message after a button is pressed.

IE6 works without any problems, but testing with Firefox3 I get a "Permission denied to get property Window.document" error on line 2 code snippet below
1 var z
2 z=top.Frame2.document;
3 z.open();
4 z.write("stuff");
5 z.close();

I have tried replacing Frame2 with a blank page, before writing, but I guess it does not get loaded fast enough.

As I said IE works, Firefox errors. Any ideas?


 
Tried testing in IE7 yet? Safari on the Mac?

...Any ideas?
Since you ask... I would suggest you look to using modern DOM methods to manipulate page content rather than document.write.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top