Closed Bug 96118 Opened 23 years ago Closed 20 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: serhunt, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(3 files)

Not sure about Component. This bug could be related to bug 92651. Screen shots 
to follow.
Attached image Mozilla screen shot
Attached image 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
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
*** Bug 100026 has been marked as a duplicate of this bug. ***
->DOM
Assignee: asa → jst
Component: Browser-General → DOM Other
QA Contact: doronr → gerardok
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.

Maybe it was down, it is accessible now. Articles at the original link are
different now but it still exhibits exactly the same problem.
*** 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>
Attached file 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
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.
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
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.
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
Closed: 20 years ago
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: