javascript

22nd April
2011
written by simplelight

Probably one of the first topics covered when you get started learning about jQuery events is the concept of canceling the browser’s default behavior. For instance, a beginner click tutorial may include this:

$(“a.toggle”).click(function () {
$(“#mydiv”).toggle();
return false; // Prevent browser from visiting `#`
});
This function toggles the hiding and displaying of #mydiv, then cancels the browser’s default behavior of visiting the href of the anchor tag.

It is in these very first examples that bad habits are formed as users continue to use return false; whenever they want to cancel the default browser action.

[]

Tags:
4th April
2010
written by simplelight

This is a great post on using the various jQuery Traversing functions to select DOM elements.

18th June
2009
written by simplelight

jQuery Tools is a great UI javascript library for web designers