Hi,
On Apr 21, 3:38 pm, Rüdiger Plantiko
wrote:
> > Surprisingly, IE8 still doesn't support it, but even if it did,
> > frankly it doesn't do what _I'd_ want.
>
> Does IE8 claim to be HTML5 compliant?
I doubt it (it would be quite a trick as the HTML5 working group
hasn't even stopped accepting
Hi Eric and TJ,
thanks for your further research in this matter!
> Surprisingly, IE8 still doesn't support it, but even if it did,
> frankly it doesn't do what _I'd_ want.
Does IE8 claim to be HTML5 compliant?
> $('test').textContent || $('test').innerText
> The only drawback I can think of i
Interestingly, Firefox's `textContent` behavior of including the
script element's contents (which I called "insanity") is *standard* as
far as I can tell -- and has been for years:
http://www.w3.org/TR/html5/infrastructure.html#textcontent
http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-text
Hi,
On Apr 13, 2:42 pm, kangax wrote:
> We've been getting these requests in the past. Take a look at, for
> example:
> http://groups.google.com/group/prototype-core/browse_thread/thread/8e...>
>
> I still think that it's not a trivial solution (for the reasons
> outlined in the post linked abov
We've been getting these requests in the past. Take a look at, for
example: http://groups.google.com/group/prototype-core/browse_thread/thread/8ef26e7cedb43afc/47033b4bc8dc4c74#47033b4bc8dc4c74>
I still think that it's not a trivial solution (for the reasons
outlined in the post linked above) and
On Apr 13, 10:39 am, Eric wrote:
> wouldn't it be wiser to check for the native method once and use it?
Probably. I'd also check for innerText (in fact, I'd check for that
first), since it's supported by IE, WebKit (so Chrome, Safari), and
Opera; only Mozilla holds out. textContent is supported b
Oooops, gmail sent the message before I finished... :o)
Here is the correct message (please ignore the previous one)
On Apr 12, 7:04 pm, "T.J. Crowder" wrote:
> Element.addMethods({
> text: function(element) {
> if (!(element = $(element))) return;
> return element.innerHTML
On Apr 12, 7:04 pm, "T.J. Crowder" wrote:
> Element.addMethods({
> text: function(element) {
> if (!(element = $(element))) return;
> return element.innerHTML.stripTags();
> }
>
> });
wouldn't it be wiser to check for the native method once and use it?
Something like (u
What I use in this case is:
$('test').textContent || $('test').innerText
If textContent is defined, it is used. if it isn't, innerText is used.
This would be a lot faster than stripping tags.
The only drawback I can think of is that sometime you may get an
undefined instead of an empty string (whi
Hi TJ,
> > I get the number 4711 in IE with $("test").innerText and in FF with $
> > ("test").textContent - does Prototype provide a browser-independent
> > abstraction for this?
>
> Hopefully you get the *string* "4711" rather than the number 4711
> (unless you parse it). :-)
You are right, in a
Hi,
> I get the number 4711 in IE with $("test").innerText and in FF with $
> ("test").textContent - does Prototype provide a browser-independent
> abstraction for this?
Hopefully you get the *string* "4711" rather than the number 4711
(unless you parse it). :-)
`innerHTML` works on all major br
11 matches
Mail list logo