Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Set/Navigate to a Location (what is the correct way?)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
stephen.cunli...@gmail.com  
View profile  
 More options Apr 13 2007, 4:21 pm
Newsgroups: comp.lang.javascript
From: stephen.cunli...@gmail.com
Date: 13 Apr 2007 13:21:04 -0700
Local: Fri, Apr 13 2007 4:21 pm
Subject: Set/Navigate to a Location (what is the correct way?)
Hi all,

This may sound real strange, but I'm curious what the "official"
answer is.

In my JS, I want to redirect/navigate to a url...

In Mozilla,

document.location.href = '{my_url}';  //works in Moz, IE6, IE7, Opera,
etc.

window.location.href = '{my_url}';  //works in Moz, IE6, IE7, Opera,
etc.

But.... there are times, in IE6, when...

document.location.href = '{my_url}';

does *NOT* work... and IE just ignores the request...

Now, from all the specs I read, it looks like location.href was only
ever intended to be read-only... but browsers seemed to make it
editable...  and in IE6, document.location.href( '{my_url}' ); even
works (sometimes), because MS added this ability because so many were
trying it, finding it not to work, and submitting bugs...

So, 2 questions...

1.) What is the "official" way to set the page location (e.g. to some
other page)
2.) If document.location.href is fine, anyone know why IE sometimes
ignores it, when it is set to a new value?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.