troubleshooting Question

IE7 a href + onclick - both happen!

Avatar of peterchamberlin
peterchamberlin asked on
Web BrowsersWeb Languages and StandardsJavaScript
12 Comments1 Solution3722 ViewsLast Modified:
I have an annoying behaviour in IE7. With an HTML page containing the following script...

<a href="" onclick="'', 'popup'); return false">Click me</a>

...if I click the link then I get a popup window, but the launching page also navigates to the href location behind it. Seemingly the href happens before the onclick event, or the onclick return value is not taken into consideration properly.

What's strange is that on other XP PCs here with IE7 it works okay, but on my work machine and home machine it doesn't. My suspicion is that VS 2005 has had some impact. I'm on VS2005 SP1 here, and original version at home.

I have reset all of IE7's settings to try to get around this problem but to no avail. I have also uninstalled the IE7 Beta3 developer toolbar. Even running in no-addon mode has no effect. Both machines are fully-patched XP SP2. I have also installed IE7 atop itself, installed M$ Script 5.6, copied registry settings from HKLM/HKCU Internet Explorer and Internet Settings from another correctly behaving XP SP2 / IE7 machine. I've tried logging on as local machine admin for a clean HKCU, nothing has fixed this.

I found some people claiming this same issue on newsgroups, others trying similar example code and getting the correct result, but no explanation in either case as to what was wrong.

This issue only affects IE7, not IE6 or Mozilla Firefox.

Thoughts, suggestions or solutions all welcome!

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 12 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 12 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004