Closed Bug 290179 Opened 19 years ago Closed 19 years ago

JavaScript 'window.location.href()' and 'history.go()' do not function properly in Firefox

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: larry.greenberg, Assigned: bugzilla)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

One of our secure Intranet sites uses JavaScript validation dynamically
generated via ASP to call a dialog box and a redirect to the previous page. 
When the OK button is clicked, Firefox PERMITS the site to continue on to the
page that the JavaScript was supposed to block.  If, however, on that page the
Refresh icon is clicked, the JavaScript behaves normally and redirects the page.
 This error also occurs in Netscape 7.0/7.1/7.2 as well as Firefox.

Reproducible: Always

Steps to Reproduce:
1.Sign on to the site with test ID that is ineligible for the selection
2.Click "Enroll".
3.Click OK in the error message dialog box.

Actual Results:  
As described in the Details paragraph.  Results are consistent every time.

Expected Results:  
Redirected the user to the pages specified in the Javascript 'history.go()' or
'window.location.href' statements.

This is a secure, business critical application.
I've never had a problem with those functions, is there an example website or
testcase that demonstrates the problem?
The history.go() issue is Bug 168150, not too sure about the
window.location.href part. 

This bug is two seperate issues and should have been filed as such.
(In reply to comment #1)
> I've never had a problem with those functions, is there an example website or
> testcase that demonstrates the problem?

This is an abridged version of the section of ASP code that always fails:

If is_error and msg <> "" Then
	Response.write("<SCRIPT LANGUAGE=" & Chr(34) & "JavaScript" & Chr(34) & ">" &
Chr(13))
	Response.write("<!--" & Chr(13))
	Response.write("alert(" & Chr(34) & msg & Chr(34) & ");" & Chr(13))
	Response.write("history.go(-1);" & Chr(13))	
	Response.write("//-->" & Chr(13))
	Response.write("</SCRIPT>" & Chr(13))		
End if
In my case I work in a LAMP environment and I make software to be used in
Linux/Windows clients, and I have had severe problems with the window.location.
It seems that the only way I can make this to work on Mozilla/Firefox browsers
is using it as the first lines of code in HTML. Unlike IE or Conqueror, that can
receice a window.location command in javascript without any problems, even when
the code is issued dynamically at runtime by a PHP server-sided script.
location.href is not a function. invalid.

(the other part, history.go() is a dupe, as mentioned above)
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.