document.getElementById() with no args throws. What should the message start with? "Document.getElementById requires ..."? "Document.prototype.getElementById requires ..."? "Document's getElementById requires ..."? "Document#getElementById requires ..."? Something else?
-
-
Replying to @really_bz @bz_moz
fwiw I've been asking MDN to standardise on "The path of the object from the global. If there isn't one, use the class name with the first upper-case part lower-cased" So, document.getElementById in this case.
2 replies 0 retweets 17 likes -
Replying to @jaffathecake
It would also be weird to have `element.querySelector` for the case when `querySelector` is called on some random Element, right?
1 reply 0 retweets 0 likes -
Replying to @really_bz @bz_moz
It's certainly less "correct" than Element.prototype.querySelector, but I think element.querySelector works better for folks who don't understand prototypes.
2 replies 0 retweets 4 likes -
Replying to @jaffathecake
Hmm. That's fair. I am definitely trying to start a balance between "correct" and "useful" and "not too noisy" here...
1 reply 0 retweets 1 like -
Replying to @really_bz @bz_moz
I used to be a fan of Element#querySelector, but I don't think it's common enough.
2 replies 0 retweets 2 likes
Yeah, I had not encountered it until today, but I also don't necessarily move in the right circles to have seen it...
-
-
This is very common in other languages such as Ruby, where standard doc tools use . for "static" and # for "instance" or equivalent.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.