Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
timdown
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
timdown
11y ago
I've had a go at implementing a simple version of innerText: https://github.com/timdown/rangy/wiki/Text-Range-Module
2.
▲
by
timdown
13y ago
How does it work?
3.
▲
by
timdown
13y ago
I'm not convinced. I think not knowing that apply() and call() exist would lead to unnecessarily clunky code, but even after over a decade of using them occasionally I still sometimes have to look up which is which. My use of them tend
4.
▲
by
timdown
14y ago
The first thing I tried to do (in current Firefox) failed: select text over two paragraphs, change text colour. The selection then changes. Not a great start.
5.
▲
by
timdown
14y ago
Obviously your decision to implement feature detection in jQuery was your own, but you're doing a disservice to the comp.lang.javascript regulars who laid this out for you. Describing David Mark as a troll is also unfair: I concede he has b
6.
▲
by
timdown
14y ago
Looks similar to the serializer module of my rangy project: http://rangy.googlecode.com/svn/trunk/demos/serializer.html
7.
▲
by
timdown
15y ago
The module pattern has its place and can be used alongside prototypes, as you know, but I absolutely agree.
8.
▲
by
timdown
15y ago
Why is IE < 9 support a low priority? Adding support would be pretty simple and wouldn't add much code, and IE < 9 is still used by a significant proportion of users.
9.
▲
by
timdown
15y ago
You can't remove all the craziness in JSLint. The warnings about using == instead of === and not having your var statements at the top of the function, for example.
10.
▲
by
timdown
15y ago
Whether the property/attribute distinction is necessary for jQuery users is one question (I strongly believe it is), but if not, the correct move would be to remove the prop() method entirely, because according to the release notes it nows
11.
▲
by
timdown
15y ago
This release is a fudge, and a partial backwards step. The jQuery team seem uncertain about what the prop()/attr() change is trying to achieve (an uncertainty that probably stems from the uncertainty underlying the whole attr() method in th
12.
▲
by
timdown
15y ago
Generally not bad, but there are some errors and oversights in here: - At the end of the "Always Use === Comparison" section, the example will throw a ReferenceError if (as is suggested) the variable `bar` has not been declared. If you're t
13.
▲
by
timdown
15y ago
No. forEach() being native doesn't prevent it from generally being slower than a foor loop, because it still has to do a function call on every iteration.
14.
▲
by
timdown
15y ago
The difference between attributes and properties is not an inane detail. It's fundamental, and if you don't understand it then you can't work reliably with the DOM, either with or without jQuery. Bottom line: use prop().
15.
▲
by
timdown
15y ago
That's quite a simplified explanation which sidesteps the issue of properties that correspond to attributes, which is where most of the confusion is going to be. And I totally disagree with your description of things like Boolean attributes
16.
▲
by
timdown
15y ago
In the case of attr(), the convenience jQuery was adding was an enormous fudge and attempted to gloss over the fundamental difference between attributes and properties, which has directly led to vast confusion and misunderstanding among dev
17.
▲
by
timdown
17y ago
For that specific case, the more verbose version is definitely better, since the undefined property of the global object can be altered. For example, this silently redefines it for the whole page: if (undefined = someVar) {...} The typeof c
18.
▲
by
timdown
17y ago
The good side of David Mark: I have read plenty of his stuff on comp.lang.javascript over some time, and my own JavaScript is good enough to tell that his understanding is deep and his code intelligent and thorough. I would say his knowledg