Closed
Bug 694530
Opened 14 years ago
Closed 13 years ago
location.href doesnt work when base target is set
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: rc, Unassigned)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; de-de) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/4.1.3 Safari/533.19.4
Steps to reproduce:
My page I am working on has a navigation with 7 menues and about hundred menue items in them in total. With onclick a menue of the seven is displayed and remains so. That is what I want and ok. In the navigation is a 8th item: a simple link. This link first shall close opened menues and after that call the wanted page in the main frame (iframe). So I didnt use a simple HTML link but a javascript function to do it.
Actual results:
The javascript function didnt work.
Expected results:
The function should have closed open menues and than open the given page in the main frame.
I isolated the problem and found that Firefox's Javascript has a problem with base target=x. My function worked when base target is not set and didnt when it is set. In Safari 4 it works without a problem. Please see attached file.
Comment 2•14 years ago
|
||
add "top"
javascript:top.link()
| Reporter | ||
Comment 3•14 years ago
|
||
My version is Firefox 3.6/MacOS X 10.4.11/PPC and my girlfriends is Firefox 4.0.1/MacOS X 10.7.2/Intel.
.top changes nothing.
| Reporter | ||
Comment 4•14 years ago
|
||
These two examples shows that this problem is not only with location.href.
| Reporter | ||
Comment 5•14 years ago
|
||
This behaviour is the same in Firefox 5, 6 and 7.
| Reporter | ||
Comment 6•14 years ago
|
||
My try to cange the target, make the location.href and change back the target was not successfull because JavaScript in Firefox cannot change the target itself. Safari 4 can.
See attachment 3 [details] [diff] [review].
| Reporter | ||
Comment 7•14 years ago
|
||
Comment 8•13 years ago
|
||
The behavior is correct. <base target> means the javascript: URI runs in the window indicated by that target attribute. That's the subframe, in this case, and in that window there is no function called "link".
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•