location.replace(location.href+'#'+stuff) problem

RESOLVED WORKSFORME

Status

()

Core
DOM
--
minor
RESOLVED WORKSFORME
17 years ago
14 years ago

People

(Reporter: av (gone), Unassigned)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

(Reporter)

Description

17 years ago
Not sure about Component. This bug could be related to bug 92651. Screen shots 
to follow.
(Reporter)

Comment 1

17 years ago
Created attachment 46474 [details]
Mozilla screen shot
(Reporter)

Comment 2

17 years ago
Created attachment 46475 [details]
IE screen shot
not sure if this should go to layout or i18n, but i don't believe it belongs in
xp apps. punt as needed.
Assignee: pchen → karnaze
Component: XP Apps → Layout
QA Contact: sairuh → petersen

Comment 4

17 years ago
This is not a Layout bug. It is related to the change of location.href that goes
on in the frame that does not work (http://gazeta.ru/lenta_body.shtml). It does
work when you go directly to it, but not when the parent URL has a # in it.
Here's the relevant script code:

<script language="javascript"><!--
function transform_url() {
h=parent.window.location.href;
i=h.indexOf('#');
if( i==-1 ) i=h.indexOf('?');
if(i!=-1){
    j=h.substr(i+1,666);
    location.replace(location.href+'#'+j);
} 
} 
//--></script>
<script language="javascript"><!--
transform_url();
//--></script>
Assignee: karnaze → asa
Component: Layout → Browser-General
QA Contact: petersen → doronr

Comment 5

17 years ago
*** Bug 100026 has been marked as a duplicate of this bug. ***

Comment 6

17 years ago
->DOM
Assignee: asa → jst
Component: Browser-General → DOM Other
QA Contact: doronr → gerardok

Comment 7

16 years ago
I'm unable to debug this because I can't seem to access
http://gazeta.ru/lenta_body.shtml
I don't see a problem with the function pasted earlier in this bug.

(Reporter)

Comment 8

16 years ago
Maybe it was down, it is accessible now. Articles at the original link are
different now but it still exhibits exactly the same problem.

Comment 9

16 years ago
*** Bug 133030 has been marked as a duplicate of this bug. ***
*** Bug 133244 has been marked as a duplicate of this bug. ***
Offhand I'd suggest looking at the line: j=h.substr(i+1,666);
The site has been changed so it avoids the problem with an early return.
We still need to find out whether this is bug in Mozilla or not.

<script language="javascript"><!--
function transform_url() {
if(navigator.appName.indexOf=='etscape') return;      // HERE
if(location.href.indexOf('#')!=-1) return;
h=parent.window.location.href;
i=h.indexOf('#');
if( i==-1 ) i=h.indexOf('?');
if(i!=-1){
    j=h.substr(i+1,666);
    location.replace(location.href+'#'+j);
} 
} 
//--></script>
Created attachment 96559 [details]
Testcase
AFAICT we are calculating the new URL the same way IE does it for exmaple.
(Which is "http://gazeta.ru/lenta.shtml#100035#100035")

But why was it only a problem in Mozilla?
Is it 'location.replace()' that rejects the URL in other browsers?
Or do they just chop off the last "#100035"?
Severity: normal → minor
Keywords: testcase
OS: Windows NT → All
Hardware: PC → All
(Reporter)

Comment 15

16 years ago
The site works fine now. I don't know if something got fixed along the way or
the site itself has changed, but feel free to mark it WFM.

Updated

15 years ago
Summary: Doesn't render the page correctly → location.replace(location.href+'#'+stuff) problem
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs

Comment 17

15 years ago
I also experience this bug.  I have set up an example page on
http://maizecoop.cropsci.uiuc.edu/bugzilla1/

It seems as if the calling object of location.replace() happens to be a frame
other than the frame from which location.replace() is called, this error is
produced.

Comment 18

14 years ago
I don't seem to be experiencing this bug anymore using Mozilla 1.5 or 1.6.  Can
anyone else confirm that this has been fixed?
What we're doing makes perfect sense, and since the site is fixed....
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.