Hi shellster, I think what you do is good. If you think it could be usefull for others, create a prototype plug- in that will does that and send it to everybody with scripteka.
-- david On 6 jan, 19:02, shellster <[email protected]> wrote: > Hello, > > First let me say that prototype js is a godsend. I use it on every > project I do now. > > I repeatedly find myself having to do something like this: > > var firstDiv = new Element('div', { > id: 'theID', > className: 'theClassName' > }).update(content); > > var replacement = new Element('div').update(firstDiv); > > oldElement = htmlText.replace(RegExp.escape(searchString), > replacement.innerHTML); > > Or sometimes I want to find how long the text of the new element will > be. In both cases I end up having to create a wrapper div, then call > innerHTML on the new div to get the text content of the original > element. What I would like to see (unless I don't know of a feature > that already exists) would be a replication of IE's outerHTML > feature. Maybe call the method htmlText(). Using firstDiv from > above, it would work like this: > > firstDiv.htmlText() or Element.htmlText(firstDiv) would return "<div > id=\"theID" class=\"theClassName\">[content]</div>" > > The closest feature I can find to this is Element.inspect(), but it > only returns (in this example): "<div id=\"theID" class=\"theClassName > \">" > > Thanks, in advance.
-- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
