summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Kaminski <kyle@xenomedia.com>2014-03-24 21:24:29 -0500
committerKyle Kaminski <kyle@xenomedia.com>2014-03-24 21:24:29 -0500
commitb40d19044568166aa01a9f3cadcd371358a91364 (patch)
tree5e41f1411bb831dc16ed2ff0e61bc1058e487794
parent9104c7c3b155a0c9d7dbefffd71987c4cc14182a (diff)
downloadwebsandbox-b40d19044568166aa01a9f3cadcd371358a91364.tar.gz
websandbox-b40d19044568166aa01a9f3cadcd371358a91364.tar.bz2
websandbox-b40d19044568166aa01a9f3cadcd371358a91364.zip
add info on stop propagation in jquery
-rw-r--r--notes.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/notes.txt b/notes.txt
index b9516a9..0780aa6 100644
--- a/notes.txt
+++ b/notes.txt
@@ -2,3 +2,10 @@
- $(function() {} is same as $(document).ready(function() {},
$(window).load(function () {} comes later in rendering process when all
tags are ready such as images
+
+- stop the default action
+ e.g. you have an anchor and register a listener for a .click() event using
+ jquery, but you don't want default href="foo" behavior so you do:
+
+ event.preventDefault(); /* prevent href from doing its job */
+ return false; /* stops bubbling up */