Jump to content

javascript window help


natalieG

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>
Link to comment
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]

Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.