Interesting Javascript notes of the day
Jul. 19th, 2007 12:38 pmWhen making sure your firefox javascript works in ie, remember these:
Oh, how much fun javascript can be!
- When declaring a new variable, firefox lets you get away with not using var, but ie seems to get grumpy when you do that.
- When appending nodes to the table, ie wants you to do something like formNode.tBodies[0].appendChild(codeRow), whereas firefox is happy to go with formNode.appendChild(codeRow)
- If you change the name of an object in javascript, the name *is* changed - but if you do an alert(object.outerHTML) to check it, you will see the old value. alert(object.name) will show that the name has, indeed, changed.
Oh, how much fun javascript can be!