Archive for the 'JavaScript' Category

Testing if Something is Undefined in Javascript

Sunday, October 14th, 2007

Had a question come up from a colleague that used to cause problems when I first started using JavaScript. How to test whether a variable is undefined:

var a = ‘defined’
if(typeof a == ‘undefined’) {
alert(’it is undefined’);
}

Tweaking other people’s JavaScript functions

Wednesday, October 10th, 2007

Javascript is an interesting language and like any language, the more you use it, the more functionality you find. Without getting into the specfics, I occasionally need to modify a site’s HTML and or JavaScript with an external JavaScript file (i.e I can’t touch the page I am modifying, I can only touch one external […]

Firebug Lite to the Rescue

Tuesday, October 2nd, 2007

Using console.log with Firebug can be a real time saver. The problem arises when you need to test the same code in IE. You can either let the code fail with errors, or comment out your logging and use the dreaded alerts. That’s where Firebug Lite comes to the rescue – it replicates some […]

jQuery and AJAX

Monday, September 24th, 2007

I have been playing around with jQuery a lot, as I am building a new site devoted to ski mountaineering. The site is progressing slowly, as I don’t have a lot of spare time these days. Hence my desire to use a js library to speed up development and abstract the browser differences.

I really enjoy […]

Javascript, Tables & InsertBefore

Sunday, November 26th, 2006

I was trying to dynamically add rows to a table and ran into a problem with both Firefox and Internet Explorer. I had a table with a couple rows of data and there was a link to add a new row at the bottom of the table (in its own row).

The javascript simply cloned the […]