var name = "Lennie";alert(name);
where you want the first characters e.g. "L" but in IE (IE is always the bad child it seams...) it returns "undefined" :-(
So you need to write it:
var name = "Lennie";
this works fine in all browsers.