Well That's a Terrible Feature
What does this mean?
A lot of developers, myself included until recently, probably do not know of this feature. Essentially assuming the window operator means that
can be shorted to just
I discovered this feature when I tried doing this:
I know real daring of me
When run in chrome this trigger gives “Uncaught Type Error: object is not a function”. In firefox it gives the slightly more helpful “function not defined”. After working the error back to the trigger I talked to some other people. Most were as flummoxed as I. That is, until I found someone who had run into the same error and pointed me to the source of the problem.
The comment_reason namespace was already occupied. It was occupied by the comment_reason object or rather the
window.comment_reason object that was instantiated when the dom was loaded.
So is this a feature or a bug?
Unfortunately this doesn’t seem to be going away. This stackoverflow entry explains what’s going on somewhat, and it would seem that this has been adopted as a core feature of html5. So for better or for worse it’s here to stay.
If anyone can give a more full explanation of why this is a worthwhile feature I’m all ears.