Archive

Posts Tagged ‘javascript’

Nine Javascript Gotchas

February 20, 2008 Leave a comment

by Patrick Fitzsimmons

1) Comma Caused Coruption

<script>
var theObj = {
city : “Boston”,
state : “MA”,
}
</script>

Notice the comma after “MA”? It will be the source of many woes. Firefox will pay it no heed, but it will create a syntax error in IE. Worst of all, IE will not tell you where the actual bug is. The only soution is to scan through your entire 2,500 line javascript file trying to find that extra comma.

Read more…

Advertisements
Categories: javascript Tags: , ,