Jump to content

Archived

This topic is now archived and is closed to further replies.

natalieG

javascript window help

Recommended Posts

In our window code beklow, when we try  to open the window.document, we get an error
message  saying "onject does not support automation". we want to write HTML code to the
window. 

Thanks,

Jennifer

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>Welcome to Adobe GoLive 6</title>
<script language="JavaScript">
function openWin(){
newWin = open("# ","window","height=400  width=400,top=200 left=200");
newWin.document.open();
}/* openwindow  */

function  closeWin(){
close(newWin);
}/*close window*/

</script>
</head>

<body bgcolor="#ffffff">
<form action="#"  method="get" name="FormName" >
<button name="buttonName" type="button" onClick="openWin()">Open</button><BR>
<button name="buttonName" type="button"  onClick="closeWin()">Close</button>
</form>
<p></p>
</body>

</html>

Share this post


Link to post
Share on other sites
I think your problem is here:
[code]
        function openWin(){
        newWin = open("# ","window","height=400  width=400,top=200 left=200");
        newWin.document.open();
        }/* openwindow  */
[/code]

Your missing commas, which is a syntax error.  Also try using window.open().
change it to:

[code]
        function openWin(){
        var obj_newWin= window.open("# ","window","height=400,width=400,top=200,left=200");
        }/* openwindow  */
[/code]

Share this post


Link to post
Share on other sites
we corrected the copmmas and tried again  and  eveything we try  casues  the same errro-
"class does not support automatiopn".  we then chan ged a bit and tried some code to do the same thing from a couple of javascript books and we get the same result.  We are using IE6 under Windows SP4, and tghere must be soemething more  fundamental at work hgere. any ideas?

Natalie

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.