Syndicate content

javascript

Bread-Crumbs for Static Files & Directories with Mootools

Recently we were tasked with implementing bread-crumb links on a client's site and not surprisingly, there were some obstacles. Being written initially using Dreamweaver templates (don't ask me why) and leveraging only the most static of technologies throughout, a server-side solution was out of the question.

And so a Javascript solution was only natural; leveraging the ever handy Mootools framework and the already existing, directory structure's naming convention to derive the bread-crumb links and names- the resulting solution was pretty elegant. Mootools v. 1.11 was likewise chosen for reasons unknown, but the example below could be converted to 1.2 version pretty easily.

Javascript: Preventing Default Event Actions

Sometimes, browsers respond to user interactions in bothersome ways. Imagine a scenario where you have a list of links, all bound to Javascript events which toggle the CSS display value of different div elements. Or maybe you're making Ajax calls for a tabbed content area or the like. Perhaps the code for the links or tabs or whatever looks like this...