in a link onclick="someFunction(); return false;" should keep the browser from following the link?

J

Jake Barnes

On this page:

http://www.bluecasts.com/ajax/Tuesday_02_14_2006_11_18_31_PM.htm

click in any of the main column boxes and a box full of links
(controls) will appear. Click "Add Paragraph." The browser (IE and
FireFox) follow the link, even though the source code says this:

<A onclick="setText(); return false;" href="index.htm">Add
paragraph</A>

why would the "return false" not cancel the default behavior of the
click? Right now the browser is following the link, but I'd prefer if
it didn't.
 
L

Lee

Jake Barnes said:
On this page:

http://www.bluecasts.com/ajax/Tuesday_02_14_2006_11_18_31_PM.htm

click in any of the main column boxes and a box full of links
(controls) will appear. Click "Add Paragraph." The browser (IE and
FireFox) follow the link, even though the source code says this:

<A onclick="setText(); return false;" href="index.htm">Add
paragraph</A>

why would the "return false" not cancel the default behavior of the
click?

Because setText() contains a serious run-time error that prevents
further Javascript from executing.
"referencetoelementtobeadded has no properties"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top