Hi,

Can anyone tell me if it's possible to write over the IE
document.html.outerHtml as a unit in script..

Thnx,
Maria

Re: document outerHTML by Bob

Bob
Sat Dec 27 18:25:53 CST 2003

Maria wrote:
> Hi,
>
> Can anyone tell me if it's possible to write over the IE
> document.html.outerHtml as a unit in script..
>
> Thnx,
> Maria

From the documentaition found at msdn.microsoft.com/library:
The property is read/write for all objects except the following, for which
it is read-only: CAPTION, COL, COLGROUP, FRAMESET, HTML, TBODY, TD, TFOOT,
TH, THEAD, TR.

So, the answer is "no".

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: document outerHTML by Maria

Maria
Sat Dec 27 19:02:53 CST 2003

Thanks, Guess I'll have to do it this way:

set h=document.createelement("html")
set d=document.createelement("head")
set t=document.createelement("title")
t.innertext="My new Document"
d.insertbefore t,null
h.insertbefore d,null
set b=document.createelement("body")
b.innerhtml="<p>hello from my new document</p>"
h.insertbefore b,null
document.replaceChild h,document.firstChild






"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:utEewlNzDHA.1680@TK2MSFTNGP12.phx.gbl...
> Maria wrote:
> > Hi,
> >
> > Can anyone tell me if it's possible to write over the IE
> > document.html.outerHtml as a unit in script..
> >
> > Thnx,
> > Maria
>
> From the documentaition found at msdn.microsoft.com/library:
> The property is read/write for all objects except the following, for
which
> it is read-only: CAPTION, COL, COLGROUP, FRAMESET, HTML, TBODY, TD,
TFOOT,
> TH, THEAD, TR.
>
> So, the answer is "no".
>
> Bob Barrows
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>


Re: document outerHTML by Han

Han
Sun Dec 28 04:11:57 CST 2003

If you elaborate more on the purpose of the script posted, someone may help
you with some idea.

"Maria" <no@spam.com> wrote in message
news:OfM$A9NzDHA.1908@TK2MSFTNGP10.phx.gbl...
> Thanks, Guess I'll have to do it this way:
>
> set h=document.createelement("html")
> set d=document.createelement("head")
> set t=document.createelement("title")
> t.innertext="My new Document"
> d.insertbefore t,null
> h.insertbefore d,null
> set b=document.createelement("body")
> b.innerhtml="<p>hello from my new document</p>"
> h.insertbefore b,null
> document.replaceChild h,document.firstChild
>
>
>
>
>
>
> "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:utEewlNzDHA.1680@TK2MSFTNGP12.phx.gbl...
> > Maria wrote:
> > > Hi,
> > >
> > > Can anyone tell me if it's possible to write over the IE
> > > document.html.outerHtml as a unit in script..
> > >
> > > Thnx,
> > > Maria
> >
> > From the documentaition found at msdn.microsoft.com/library:
> > The property is read/write for all objects except the following, for
> which
> > it is read-only: CAPTION, COL, COLGROUP, FRAMESET, HTML, TBODY, TD,
> TFOOT,
> > TH, THEAD, TR.
> >
> > So, the answer is "no".
> >
> > Bob Barrows
> >
> > --
> > Microsoft MVP - ASP/ASP.NET
> > Please reply to the newsgroup. This email account is my spam trap so I
> > don't check it very often. If you must reply off-line, then remove the
> > "NO SPAM"
> >
> >
>



Re: document outerHTML by Maria

Maria
Sun Dec 28 12:58:21 CST 2003

Well I made a custom IE Explorer bar to edit HTML Documents, however I
don't feel it's complete unless I can display the outer html, edit it,
and paste it back -- without going through the file system... After all,
you can delete the DocumentElement from the document or replace it with
a new one, so why can't you edit it?
Maria




"Han" <hp4444@kornet.net> wrote in message
news:%23vusIsSzDHA.2116@TK2MSFTNGP11.phx.gbl...
> If you elaborate more on the purpose of the script posted, someone may
help
> you with some idea.
>
:
:
:
:


Re: document outerHTML by Han

Han
Sun Dec 28 23:17:41 CST 2003

Then this example may be a hint for you. It's HTML Dom. The second
child(<body>) of the documentElement or <html> has "bbb" at loading. After
you click the msgbox, the second children or <body> will have different
value.

<HTML>
<HEAD>
<SCRIPT language=vbscript>

sub window_onload

msgbox document.documentElement.innerHtml

document.documentelement.children(1).innerHtml="<div>bbb</div>"

end sub

</SCRIPT>
</HEAD>
<BODY>

<div>aaa</div>

</BODY>
</HTML>

--
Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
Have a nice day.

"Maria" <no@spam.com> wrote in message
news:uRQjuUXzDHA.2060@TK2MSFTNGP10.phx.gbl...
> Well I made a custom IE Explorer bar to edit HTML Documents, however I
> don't feel it's complete unless I can display the outer html, edit it,
> and paste it back -- without going through the file system... After all,
> you can delete the DocumentElement from the document or replace it with
> a new one, so why can't you edit it?
> Maria
>
>
>
>
> "Han" <hp4444@kornet.net> wrote in message
> news:%23vusIsSzDHA.2116@TK2MSFTNGP11.phx.gbl...
> > If you elaborate more on the purpose of the script posted, someone may
> help
> > you with some idea.
> >
> :
> :
> :
> :
>



Re: document outerHTML by Han

Han
Sun Dec 28 23:22:28 CST 2003

OOPs I mean "aaa" by "bbb" in my earlier explanation.

--
Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
Have a nice day.

"Maria" <no@spam.com> wrote in message
news:uRQjuUXzDHA.2060@TK2MSFTNGP10.phx.gbl...
> Well I made a custom IE Explorer bar to edit HTML Documents, however I
> don't feel it's complete unless I can display the outer html, edit it,
> and paste it back -- without going through the file system... After all,
> you can delete the DocumentElement from the document or replace it with
> a new one, so why can't you edit it?
> Maria
>
>
>
>
> "Han" <hp4444@kornet.net> wrote in message
> news:%23vusIsSzDHA.2116@TK2MSFTNGP11.phx.gbl...
> > If you elaborate more on the purpose of the script posted, someone may
> help
> > you with some idea.
> >
> :
> :
> :
> :
>



Re: document outerHTML by Maria

Maria
Mon Dec 29 10:13:43 CST 2003

Well now, nice try Han. However, editing Child(1).innerHtml, which of
course is the BODY element, is no problem. However I want to edit all
the elements in the document, even those that come before the
DocumentElement.

This of course can be done by recreating the document with edited parts
from the old document and -> REPLACE. Try this:

window.alert(document.documentElement.outerHtml)
set x=document.createElement("HTML")
document.replaceChild x,document.documentElement
window.alert(document.documentelement.outerhtml)

Maria---------------
-------------------

"Han" <hp4444@kornet.net.korea> wrote in message
news:unxuUsczDHA.3520@tk2msftngp13.phx.gbl...
> Then this example may be a hint for you. It's HTML Dom. The second
> child(<body>) of the documentElement or <html> has "bbb" at loading.
After
> you click the msgbox, the second children or <body> will have
different
> value.
>
> <HTML>
> <HEAD>
> <SCRIPT language=vbscript>
>
> sub window_onload
>
> msgbox document.documentElement.innerHtml
>
> document.documentelement.children(1).innerHtml="<div>bbb</div>"
>
> end sub
>
> </SCRIPT>
> </HEAD>
> <BODY>
>
> <div>aaa</div>
>
> </BODY>
> </HTML>
>
> --
> Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
> Have a nice day.
>


Re: document outerHTML by Maria

Maria
Mon Dec 29 15:30:40 CST 2003

In other words, what I am trying to do is
create a document from a string.

The program will analyze the string and create
all the elements on the fly, complete with
attributes.

I know it can be done with a little work. I was
just wondering if anyone else had tried this???