JavaScript Patterns Collection

A JavaScript pattern and antipattern collection that covers function patterns, jQuery patterns, jQuery plugin patterns, design patterns, general patterns, literals and constructor patterns, object creation patterns, code reuse patterns, DOM and browser patterns (upcoming). General Patterns Function Declarations – creating anonymous functions and assigning them to a variable Conditionals – pattern and antipattern of using… Continue reading JavaScript Patterns Collection

Advantages of using pure JavaScript over JQuery

First off – it’s impossible to use jQuery only, all jQuery does is add a $ object to your global scope, with a bunch of methods in it. Even more manipulative libraries like prototype aren’t an alternative to javascript, they’re a toolbelt to solve common problems. The main advantages to adding jQuery to your toolbelt… Continue reading Advantages of using pure JavaScript over JQuery

Difference between event.preventDefault(), event.stopPropagation() and return false in jquery

Let me start by stating the behavior of all three when used in jquery event handling: event.preventDefault(): Prevents the default action of the event from triggering. Does not stop the event propagation to parent DOM elements. event.stopPropagation(): Prevents the default action of the event from propagating to parent DOM elements. return false: Does what both… Continue reading Difference between event.preventDefault(), event.stopPropagation() and return false in jquery