Open Bug 680672 Opened 13 years ago Updated 2 years ago

window.location works wrong in FF6

Categories

(Firefox :: General, defect)

6 Branch
x86
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: lars.hansen, Unassigned)

Details

Attachments

(1 file)

Attached file leereSeite.html
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0
Build ID: 20110811165603

Steps to reproduce:

Let run a JavaScript


Actual results:

Current Page reloads


Expected results:

Page as specified by JavaScript should have been loaded
Attachment #554634 - Attachment mime type: text/plain → text/html
Attached is the page containing the JavaScript in question. (This page is meant to be the start page for empty tabs in FFs fullscreen mode because there is no adress bar in FFs fullscreen mode.)

The page resides in the local filesystem. Its url is a file:// url.

A web url is typed into the text box and "Enter" is pressed.

When window.location is used in JavaScript, the current page (file://) reloads while the value assigned to window.location should have been loaded.
Removing <form> and </form> makes the program work. Someone else has to explain why.

BTW, your example has two </body>, but it doesn't seem to affect the test results.
Just for testing...

This loads the new location when typing any letter:

<!doctype html>
<html>
  <head>
    <script type="text/javascript">
      function gotolocation(e)
      {
      window.location="http://www.example.com"; 
      }
    </script>
  </head>
  <body>
    <form>
      Type any letter: <input type="text" onkeypress="javascript:gotolocation(event)" id="adress" />
    </form>
  </body>
</html>

But this loads the old location when pressing Enter:
<!doctype html>
<html>
  <head>
    <script type="text/javascript">
      function gotolocation(e)
      {
      if(e.keyCode==13){
      window.location="http://www.example.com"; 
      }
      }
    </script>
  </head>
  <body>
    <form>
      Press Enter: <input type="text" onkeypress="javascript:gotolocation(event)" id="adress" />
    </form>
  </body>
</html>
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: