12 June 2007

The joys of JavaScript error messages

Today I meant to type

someObject.someProperty
but instead I typed
someObject..someProperty
with the incorrect extra period.

Firefox kicked back the amazingly helpful

XML descendants internal method called on incompatible Object
which I stared at dumbfounded. All of Firebug's glorious power was seemingly useless against this error. It didn't help that I was working atop a custom Dojo build.

Then I flipped back to my editor which thankfully still had the cursor next to the extra period. A simple backspace and I was moving again...

19 comments:

Anonymous said...

thanks, man.I had the same error and you saved me a couple of minutes.

Anonymous said...

Same here! Damn typo's! Thanks!

Anonymous said...

Thanks... this error looked a bit scary at first glance... but as I suspected, it was all bark and no bite. Thanks for the quick synopsis on what was causing it! :D

Mike Desjardins said...

THANK YOU! THANK YOU! Same double-period, I'm glad you posted this!

Anonymous said...

Same here.. Thanks a ton!!

Anonymous said...

Thanks a bunch. Your post saved a lot of time.

Shane said...

Saved me some time too. Thanks.

Tony Barnes said...

God damn, saved me crying after finally cobbling together my first javascript page...

A thousand thankyous!!

Unknown said...

Cheres just saved me hours trying to find out what that meant!

Vishu said...

Thanks :-)

i've written username..val() while validating!!

have beer! ;)

Anonymous said...

Great tip. Saved me loads of time I'm sure!

Anonymous said...

Thanks a zillion. Indeed Firebug did all the work for me.

Oscar Bravo said...

One more thanks for pin-pointing the error!

However, a cautionary note if you encounter a double-period in your code; it may not simply be a extra period, it could be a missing element in the object definition. For example, "this..id" may really have been "this.wibble.id". So it might not just be a case of removing one of the periods.

I know, I was that marine...

Anonymous said...

OH MAN AWESOME THANK YOU

Manish Ranjan said...

Thanks a lot mate :)

Anonymous said...

You just saved me. Facepalm! Thanks for posting!

Anonymous said...

oh man thank u soo much

Anonymous said...

WOW i dont believe it LOL it was that :) thanks a lot

Anonymous said...

I just spended 1 hour of my life in this! Double f***ing periods

Subscribe Subscribe to The Return of Agent Zlerich