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:

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

    ReplyDelete
  2. Same here! Damn typo's! Thanks!

    ReplyDelete
  3. 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

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

    ReplyDelete
  5. Same here.. Thanks a ton!!

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

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

    A thousand thankyous!!

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

    ReplyDelete
  9. Thanks :-)

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

    have beer! ;)

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

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

    ReplyDelete
  12. 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...

    ReplyDelete
  13. OH MAN AWESOME THANK YOU

    ReplyDelete
  14. Thanks a lot mate :)

    ReplyDelete
  15. You just saved me. Facepalm! Thanks for posting!

    ReplyDelete
  16. oh man thank u soo much

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

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

    ReplyDelete