On Feb 4, 11:03 pm, kangax <[EMAIL PROTECTED]> wrote:
> Chris,
>
> Unfortunately, only IE has outerHTML (which is what you need).

Gecko browsers have XMLSerializer , as do a number of others such as
Opera and Safari (but not IE):

<URL: http://developer.mozilla.org/en/docs/XMLSerializer >

You can use outerHTML for IE and for the others something like:

  new XMLSerializer().serializeToString(element)

Opera also supports useful parts of the W3C DOM 3 Load and Save spec.
that others don't.

<URL: http://www.w3.org/TR/DOM-Level-3-LS/ >

While the above are aimed at XML, they work quite nicely with HTML.


> You could try something like this:
>
> Element.addMethods({
>   toOuterHTML: function(element) {
>     return $(element).cloneNode(true).wrap().innerHTML;

innerHTML is not particularly reliable across browsers if you modify
the element dynamically.


--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to