From b40d19044568166aa01a9f3cadcd371358a91364 Mon Sep 17 00:00:00 2001 From: Kyle Kaminski Date: Mon, 24 Mar 2014 21:24:29 -0500 Subject: add info on stop propagation in jquery --- notes.txt | 7 +++++++ 1 file changed, 7 insertions(+) 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 */ -- cgit v1.2.3