Thats hy i was cloning and injecting it into a textarea, so i could do a
get("html") on the textarea and then have all of the html. Is this not a
good way?
-----Original Message-----
From: Matthew Hazlett [mailto:[email protected]]
Sent: Monday, 19 March 2012 5:36 PM
To: [email protected]
Subject: Re: [Moo] Copying the HTML document
I added a getTagfunction.
Also fixed an error in webkit browsers for dropdown lists
function getTag(name){
var dump = $(document.html).outerHTML,
regex = new RegExp('<'+name+'[^>]*>','im'), match = regex.exec(dump);
return match[0];
}
as you can see getTag uses the outerHTML property and grabs the full text of
the tag directly.
I believe outerHTML was recently added to the latest version of FireFox, so
if you are a version back it wont work. I'll add a error trap there and the
only thing I can think of is just to return the tag as <html>.
This hasnt been tested cross browser yet
The url is: http://jsfiddle.net/hazlema/BwczU/35/ haven't made it the base
yet because it isn't tested.
as for a doctype decleration, I have looked into this and can find no way
that will work with every doctype.
Remember, IE will throw a fit and give you an error with this demo, its just
the blasted iframe though, the script works.