Closed Bug 351074 Opened 18 years ago Closed 14 years ago

document.domain is null

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: m.gasiorska, Unassigned)

Details

(Whiteboard: [CLOSEME 5-15-2010])

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Build Identifier: 

I am working on a shopping cart using javascript and frames. 
There are some pages that I have to created dynamically.
All pages work fine until I hit refresh / reload button.  
at this point I cannot write to other frame, and I get an error permission denied.  For some reason after I refresh my page - document.domain becomes null.
Before refresh it is localhost.


Reproducible: Always



Expected Results:  
document.domain should still be localhost
This works in IE - so I don't believe it is my code.
It also works before I refresh the page.
Are you using document.write, or other frames with data: URLs, or something strange like that?  A simple testcase demonstrating the bug would be nice.
(In reply to comment #1)
> Are you using document.write, or other frames with data: URLs, or something
> strange like that?  A simple testcase demonstrating the bug would be nice.

====
I will try my best to explain what is I am doing - if you have more questions let me know.

I have 4 frames.  Top Frame (this is where the logo goes)
2 right hand side frames; top-side and bottom-side, and main or middle frame where the main content of the website exists.  (Similar to peapod's website)
Anyhow, I do a lot of writting between middle (main) frame and top-side frame.
To "push" information (I am not re-writting the top-side frame) to top-side frame (frame name is target_frame) I am using javascript - parent.target_frame.document.displayform.hd_items.value += item
Upto this point everything works fine.  My top-side frame has a button "create order" which calls a javascript function to create an HTML page that displays information about the product that the user chose to buy.

I will include a snipit of the favascript function
================================
Function review_order()
{
	parent.main_frame.document.open("text/html","replace");

	parent.main_frame.document.writeln("<html><head><title>Your Order Form</title>");
	
	parent.main_frame.document.writeln("<META http-equiv=Content-Type content=\"text/javascript; charset=UTF-8\">");
	parent.main_frame.document.writeln("<META http-equiv=Content-Type content=\"text/html; charset=UTF-8\">");

	parent.main_frame.document.writeln("<LINK href=\"cssfiles/cart.css\" type=\"text/css\" rel=\"stylesheet\">");

	parent.main_frame.document.writeln("<script src=\"functions.js\"></script>");
	parent.main_frame.document.writeln("<script type=\"text/javascript\">");

	parent.main_frame.document.writeln("</script>");
	parent.main_frame.document.writeln("</head>");
	
	parent.main_frame.document.writeln("<Body><BR><BR>");

============================================================
Once my dynamic page is created everything works - and I am still able to write between the frames.

But as soon as the user hits the refresh button, the middle (main) frame, stops working, and I am no loger able to write to the top-side frame.

I have found out the document.domain becomes null after the refresh.
All of the frames are on the same domain.  I am running everything from my local machine, inetpub.  The domain should be localhost between all of the frames.

I do not believe I am doing anything strange, but this happens only to the dynamically created pages.

Once again - thank you for your response, and please let me know if you have any other questions to help you resolve this.

Thank you.



Reporter, are you still seeing this issue with Firefox 3.6.x or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Whiteboard: [CLOSEME 5-15-2010]
No reply, INCOMPLETE. Please retest with Firefox 3.6.x or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.