473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

top.location.replace()

Do a search at this site:

http://www.mindsift.com/

Select a non-sponsored link, then give the site a rating. The rating
frame closes. Now click your "back" button. If you're using IE, you'll go
back to the search results. This is the desired behavior. In NS, FF and
Opera, it takes you back to the frameset. I'm using top.location.replace;
from my understanding that should do it. I *hate* it when only IE does
what I want.

Any ideas why this doesn't work, or how I can achieve the desired
behavior? I inherited this code from someone else. I tried using the
closeframe() method which they used for the "remove this frame" link, but
that just closes the frame, and leaves the history entry, so that you
still have to back up twice to get to the search results.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Mar 19 '06 #1
5 5074
Alan Little wrote:
Do a search at this site:

http://www.mindsift.com/

Select a non-sponsored link, then give the site a rating. The rating
frame closes. Now click your "back" button. If you're using IE, you'll go
back to the search results. This is the desired behavior. In NS, FF and
Opera, it takes you back to the frameset. I'm using top.location.replace;
from my understanding that should do it. I *hate* it when only IE does
what I want.

Any ideas why this doesn't work, or how I can achieve the desired
behavior? I inherited this code from someone else. I tried using the
closeframe() method which they used for the "remove this frame" link, but
that just closes the frame, and leaves the history entry, so that you
still have to back up twice to get to the search results.


IIRC, top.location.replace is IE only.
Mar 19 '06 #2
Carved in mystic runes upon the very living rock, the last words of
TheBagbournes of comp.lang.javascript make plain:
Alan Little wrote:
Do a search at this site:

http://www.mindsift.com/

Select a non-sponsored link, then give the site a rating. The rating
frame closes. Now click your "back" button. If you're using IE,
you'll go back to the search results. This is the desired behavior.
In NS, FF and Opera, it takes you back to the frameset. I'm using
top.location.replace; from my understanding that should do it. I
*hate* it when only IE does what I want.

Any ideas why this doesn't work, or how I can achieve the desired
behavior? I inherited this code from someone else. I tried using the
closeframe() method which they used for the "remove this frame" link,
but that just closes the frame, and leaves the history entry, so that
you still have to back up twice to get to the search results.


IIRC, top.location.replace is IE only.


I can't find anything that says that, and I'm able to reference the top
object for other things (I also tried parent) and use the replace method
in other browsers, just not together.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Mar 19 '06 #3
Alan Little said the following on 3/19/2006 6:40 PM:
Carved in mystic runes upon the very living rock, the last words of
TheBagbournes of comp.lang.javascript make plain:
Alan Little wrote:
Do a search at this site:

http://www.mindsift.com/

Select a non-sponsored link, then give the site a rating. The rating
frame closes. Now click your "back" button. If you're using IE,
you'll go back to the search results. This is the desired behavior.
In NS, FF and Opera, it takes you back to the frameset. I'm using
top.location.replace; from my understanding that should do it. I
*hate* it when only IE does what I want.

Any ideas why this doesn't work, or how I can achieve the desired
behavior? I inherited this code from someone else. I tried using the
closeframe() method which they used for the "remove this frame" link,
but that just closes the frame, and leaves the history entry, so that
you still have to back up twice to get to the search results.

IIRC, top.location.replace is IE only.


I can't find anything that says that, and I'm able to reference the top
object for other things (I also tried parent) and use the replace method
in other browsers, just not together.


..replace() on the location object is far from IE only.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 20 '06 #4
TheBagbournes wrote:
IIRC, top.location.replace is IE only.


You "remember" incorrectly. This method is supported since JavaScript 1.1
(in Netscape). It is therefore supported by virtually all script-enabled
Web browsers.
PointedEars
Mar 20 '06 #5
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.javascript make plain:
Any ideas why this doesn't work, or how I can achieve the desired
behavior?


OK, this is driving me nuts, and if I don't get this figured out soon, I
going to go postal on some browser programmers.

With a great deal of blood, sweat and tears and some voodoo involving a
severed chicken head, a browser sniffer and a spatula, I was able to get
it to work in FF and Opera. The only holdout is NS, and I'd really like
to get it to work before the devil comes to claim my soul on the deal I
did for the other two.

NS has been entertaining me with all kinds of idiocy. If I minimize the
ratings frame, like I do for FF and Opera, NS just blinks at me, and
creates four copies of the target URL in the history, but three of them
are dead -- the Back button doesn't work, and the only way to go back is
to make a selection from the dropdown. In several of the thousands of
solutions I've attempted (any of which, logically, should have worked),
everything is fine until I add the location setting. It then skips
everything except the location setting, tacking the target URL onto the
history, and sometimes making dead copies. Although with one of the
solutions (I forget which one), I did discovere that I could get it to
work if I add an alert() in there. That's F*ING logical, right?

Can anybody provide some insight, perhaps suggest a way to get NS to do
what I'm trying to do? Anybody? Anybody? While I still have one or two
shreds of sanity left?

The JS file is at http://www.mindsift.com/html/programs/drate.js

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Mar 27 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andoni | last post by:
Hi, I am only writing for IE 5.5+ so no need for compatibility at all ;-) I am trying to get my users to logoff which they finish on a particular page. This is no problem (or should be no...
2
by: James Marshall | last post by:
I'm trying to override location.replace() but I can't. I can override window.open(), document.write(), and other built-in methods, but not location.replace(). Here's a demo that overrides two...
5
by: spam_me_ not | last post by:
I already understand that one cannot disable a browser's forward and back functions. This is a situation where I have code working in Mozilla V1.6 and would like something similar for Opera and...
10
by: Roland | last post by:
Hello, the example code is the following(the number in parentheses at the beginning are just for reference)(The complete HTML file is at the end of this article): (1)window.location =...
1
by: solutions | last post by:
Hi, Here is my relevant code for an arbitrary page (let's call it PAGE_B): <body onload="window.location.hash='anchor';"> With this code, if the user goes from PAGE_A to PAGE_B, he will jump...
2
by: JHB | last post by:
Hi, How can I do a location.replace when I use a form, like when I use a href? This works. <a href="Ny HTML-side20.htm"; method="post" id="frm" name="BrugerHovedSide"...
3
by: Al | last post by:
Hi all... I have created an aspx page that contains an animated GIF. I am using javascript and location.replace to redirect from this page to another aspx page which takes several seconds to...
9
by: Jean Pierre Daviau | last post by:
Hi everybody, I have this function in a page (namely cours.html) function go(inValue) { var lien = 'file:///F:/MyWebs/jeanpierredaviaucom/httpdocs/cours1.html?T1=' + document.R.T1.value;
12
by: Jack | last post by:
Since, I have not got some desired advise, I am reposting this for some asnwer/valuable suggestion. Thanks. THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE <% sql01 = "SELECT COUNT(*) AS...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.