HighDots Forums  

Re: onclick="alert('hello');return false;" does not work in IE7?

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: onclick="alert('hello');return false;" does not work in IE7? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Duncan Booth
 
Posts: n/a

Default Re: onclick="alert('hello');return false;" does not work in IE7? - 12-05-2006 , 04:40 AM






alvin.yk (AT) gmail (DOT) com wrote:

Quote:
Hi,

Normally, a piece of code such as

a href="http://www.yahoo.com" onclick="alert('hello');return
false;">link</a

will stop the browser from actually going to href's destination.
However, this is not the case with the IE7 I am using. What has
changed?

You have a newline after 'return', so javascript will insert a semicolon
before 'false'. Try taking out the newline and it works fine.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.