Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

location.href does not work in IE5 - ANY IDEAS?

Status
Not open for further replies.

ujohnc00

Programmer
Jun 2, 2004
13
US
Hello
The following line works correctly on my developement computer (IE5.5), but not on other computers (IE5):

self.location = "1358.cfm?action=view&method=search";

I have also tried the following to no avail:
self.location.href
location.href
window.href
window.location.href

Please help me. I don't know if this is a problem with IE, or a problem with local/remote access.

Thanks!
 
Thanks for you reply.
I have modified the line to be to be:

self.location = "
Still, nothing happens. It is not as though I get taken to an incorrect location, the browser simply does not go anywhere at all. It is as though my little function is returning false, even though there is only the above line in the function. And it works in IE....

Any other thoughts? This bug is terrible.
 
If it acts as if it is returning false, try adding a "return true;" to the function.

I'm just guessing at possible solutions here. I've never seen the problem before. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
I have a different possibility now.
Does it matter from where you make a call to a javascript function? My call is being made from inside of a table inside of a form; IE5.5 is ok with this, is IE5?

thanks
 
try this:

Code:
<a href=&quot;javascript:void(0)&quot; onclick=&quot;location.href = '[URL unfurl="true"]www.domain.com';return[/URL] false;&quot;>

Or even better, write a javascript function called loadURL or the like:

Code:
<script language = &quot;javascript&quot;>
  function loadURL(sURL) {
    location.href = sURL;
  }
</script>

...

<a href=&quot;javascript:void(0)&quot; onclick=&quot;loadURL('[URL unfurl="true"]www.domain.com');return[/URL] false;&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top