Get updates

Bubbling

Scott JavaScript Event Delegation

Coding interactive behavior into “dumb” HTML elements is one of the basic scenarios for JavaScript use. The standard method is usually to hunt through the DOM looking for elements of a certain id or class and attach an event handler function directly to each one.

For most types of events, there’s a better way: Event Delegation. At the basic level it involves attaching an event delegation function to a parent element, then catching events which bubble up and passing them off to specific handlers based on the event’s target.

Continue Reading…

3DM Design is where Scott Drake publishes thoughts on programming web applications in JavaScript and Ruby.

Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /home/dmetro/3dmdesign.com/wp-content/plugins/popularity-contest/popularity-contest.php:2531 Stack trace: #0 /home/dmetro/3dmdesign.com/wp-content/plugins/popularity-contest/popularity-contest.php(2495): akpc_is_searcher() #1 /home/dmetro/3dmdesign.com/wp-includes/class-wp-hook.php(286): akpc_api_footer_javascript('') #2 /home/dmetro/3dmdesign.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 /home/dmetro/3dmdesign.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /home/dmetro/3dmdesign.com/wp-includes/general-template.php(2630): do_action('wp_footer') #5 /home/dmetro/3dmdesign.com/wp-content/themes/hex_columns/footer.php(36): wp_footer() #6 /home/dmetro/3dmdesign.com/wp-includes/template.php(688): require_once('/home/dmetro/3d...') #7 /home/dmetro/3dmdesign.com/wp-includes/template.php(647): load_template('/home/dmetro/3d...', true) #8 /home/dmetro/3dmdesign.com/wp-includes/general-template.php(76): locate_t in /home/dmetro/3dmdesign.com/wp-content/plugins/popularity-contest/popularity-contest.php on line 2531