Terry Christopher Dunham - Portland, Oregon Graphic Designer

illustration, graphic design and web design from Portland, Oregon

terrytoledo.com - web design, graphic art and illustration

Please click on the heading to view the source

The difference between ‘return false;’ and ‘e.preventDefault();’

Posted on Jul8 2010

Have you ever seen those two things (in the title) being used in jQuery? Here is a simple example: $(“a”).click(function() { $(“body”).append($(this).attr(“href”)); return false; } That code would append the href attribute as text to the body every time a link was clicked but not actually go to that link. The return false; part of [...]

Topic: CSS Tricks | Tags: None | stumble | digg | del | tech