Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] link onclick=location.href not working


  • From: lau at goldenweb.com.au (Lau@xxxxxxxxxxxxxxxx)
  • Subject: [Javascript] link onclick=location.href not working
  • Date: Tue Mar 30 03:12:30 2004

I'm having trouble changing the window.location.href from the onclick event
of a link. using IE5.0
It works if the link is wrapped around a button but if its wrapped around
text or an image.

This works
<A HREF='#aa' onclick='window.location.href =
"http://www.google.com";;'><INPUT TYPE=BUTTON VALUE="BUY"></A>

but this doesn't
<A HREF='#aa' onclick='window.location.href =
"http://www.google.com";;'>aaaa</A>

In my actual code I have a function in the onclick that determines the URL
to assign.

It works in IE6.0 but I need to get it working in all browsers.

Could you please test this on your version browser and let me know if it
works or not?

And what workaround can I use.

Thanks in advance
Lau