This morning I had to implement an interactive map that allows one to locate local dealers of GPS equipment. The site I needed to do this on is running an extremely old version of prototype.js (version 1.5, circa 2007) and moodom.js (the precursor to MooTools). I didn’t want to use these outdated libraries to create the little interactive app. I would normally use MooTools, but I needed a library I could namespace so that I wouldn’t step on Prototype’s shoes. I grabbed the latest build of jQuery, namespaced it using the jQuery.noConflict(); technique, wrote my code, and included it right before the /body tag of document.
Everything worked fine in Firefox and IE. When I went to test it in Chrome and Safari non of the functionality worked and I received an error such as “TypeError: Result of expression ‘jQuery(document).ready’ [undefined] is not a function”. I tried some workarounds and got rid of the above error but was stuck with “Error: NOT_SUPPORTED_ERR: DOM Exception 9″ referring to line 1081 of prototype.js.
Eventually, in searching the net, I stumbled across the solution. If you need to use jQuery with an old version of prototype/scriptaculous/moodom, make sure you load your namespaced jQuery library, and any jQuery code you write, BEFORE the other legacy js frameworks. Works like a charm now.
By Tim Dupree at 9:54 am on July 21st, 2009
Topics: Coding, MooTools | 1 Comment »
There was a submission about “What makes a good programming font?” on HN today and, as usual, the comments on the submission proved more enlighting than the actual linked post (Hacker news has a great community). From the comments I came across some nice programming fonts; Envy Code R and Bitstream Vera Sans Mono. The user who posted about the Vera Sans Mono font also added a picture of it in action here. I liked the syntax highlighting/code coloring of that code screenshot, so naturally I set out to try out something similar with dreamweaver and TextPad.
I have to say, I’m disappointed in the both of them. While you can go to a preferences pane and change the code coloring in both editors, neither supports creating, saving, and loading new color schemes files. Additionally, both editors made the whole process cumbersome to change just one color as there was no instant application of the change to the document, so I was forced to apply the changes and close the settings box every time I changed something to see how it looked. Weak.
I think I am going to try the Envy Code R for a while and see how it goes. I never got a color scheme going that looks like the nice screen shot (I did in TextPad but it was only applied to the working document), oh well.
In searching for answers I did come across a nice addition to the Dreamweaver Syntax highlighter which adds support for MooTools.
By Tim Dupree at 7:06 pm on December 22nd, 2008
Tags: dreamweaver, fonts, MooTools
Topics: Coding, MooTools | 1 Comment »