473,287 Members | 1,565 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,287 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 5068
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.