This works for me:
<html><head><title>PHP output result page</title></head>
<body onload="fnAdd()">
<script language="vbScript">
function fnAdd()
document.body.insertAdjacentHTML "BeforeEnd", _
"<center><BUTTON onclick=fnBye()>Close window</BUTTON><center>"
end function
function fnBye()
close
end function
</script>
</body></body></html>
Hope it helps,
Csaba Gabor
Quote:
> Could someone show a novice how to insertAdjacentHTML
> with VBScript, or use some other VBS approach
> to _add_ a window closing button to this HTA.
> I have tried many approaches, including several
> convoluted ones, but none successful. This JScript
> does what I'm looking for, but I'd rather use VBS.
> Thanks
> ---...---
> End Sub
> </script>
> <script language="JScript">
> function fnAdd()
> {
> document.body.insertAdjacentHTML("BeforeEnd","<center><BUTTON
> onclick=fnBye()>Close window</BUTTON><center>")
> }
> function fnBye()
> {
> close();
> }
> </script>
> </head>
> <body>
> ---...---