Open
Bug 680672
Opened 12 years ago
Updated 5 months ago
window.location works wrong in FF6
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: lars.hansen, Unassigned)
Details
Attachments
(1 file)
1.52 KB,
text/html
|
Details |
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
Updated•12 years ago
|
Attachment #554634 -
Attachment mime type: text/plain → text/html
Reporter | ||
Comment 1•12 years ago
|
||
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.
Comment 2•12 years ago
|
||
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.
Comment 3•12 years ago
|
||
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>
Updated•5 months ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•