[Proto-Scripty] Proposal: Alias "clearContent" for "update()"

2010-04-12 Thread Rüdiger Plantiko
Hi, I didn't find a method for clearing the content of an HTML element *and* which from its name clearly indicates this action. I formerly used $("myContainer").update() for clearing the element's content, i.e. calling the update method with no arguments. But I prefer a readable alias like Elemen

[Proto-Scripty] Cross-browser function for Text content

2010-04-12 Thread Rüdiger Plantiko
Hi there, is there a cross-browser function for retrieving the text content of an element? If I have an element like 4711 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? Regards, Rüd

[Proto-Scripty] Re: Cross-browser function for Text content

2010-04-12 Thread Rüdiger Plantiko
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

[Proto-Scripty] Re: Cross-browser function for Text content

2010-04-21 Thread Rüdiger Plantiko
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