Rogue IDs

You’ve spent the past hour (or more) looking at your javascript code, clueless as to why it’s not working. You’ve written the similar code many times. What have you forgotten? You start throwing in alerts, backing out pieces of code. Nothing’s working!!!

Here’s what to do if your code has a document.getElementById instruction in it. Check to make sure that you don’t have more than one element on your page with the same Id. It’s easy to do if you are cutting and pasting pieces of code. It’s what I found after spending at least an hour two days ago trying to figure out what in the world I had done wrong. It’s a frustrating bug because all you can say when you finally figure out what you did is – “DOH!”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s