Archive for the ‘javascript’ Category

Google JSAPI in TextMate

I’ve found myself using the Google AJAX libraries API recently. The benefits include reduced page loading time thanks to caching per library rather than per library and per site. Typing the script src tag and the google.load code over and over becomes tedious however and doesn’t agree with the TextMate ethos. Hence I came up with a snippet, which I want to share, for including a Google hosted JS library. (more…)

Smart empty text field automatically

UPDATE: This code needs some work still!

I think everyone has seen a form on a web page that has text fields that automatically empty when they receive focus. I’ve added this functionality to countless fields over the years and the behaviour I used to to this has evolved more and more. Using Prototype and the following script you can have fields intelligently empty themselves. (more…)