Forum Moderators: open
The script gives a hotmail/yahoo style richtext interface, and allows you to toggle between HTML code and webpage view for editing.
My problem is as it stands the script only displays either:
HTML code from just after teh BODY tag to just before the closing BODY tag - uses the InnerHTML DOM attribute to pull this.
or
HTML code from just before the BODY tag to just after - using the OuterHTML DOM attribute
does anyone know a way of getting it to display the ENTIRE HTML, from HTML tag to closing tag?
I'm stumped!
function setMode(bMode) {
var sTmp;
isHTMLMode = bMode;
if (isHTMLMode) {
sTmp=idContent.document.body.outerHTML;
idContent.document.body.innerText=sTmp;
} else {
sTmp=idContent.document.body.innerText;
idContent.document.body.outerHTML=sTmp;
}
idContent.focus();
}
where document.body is limiting the HTML i can pull from the page to what is between the BODY tags either including or not including the BODY tags depending on whether innerHTML or outerHTML is used.
I'm aware there is a document.all property but this doesn't seem to work!
Any ideas :-¦