summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */