Jump to content


Photo

javascript window help


  • Please log in to reply
2 replies to this topic

#1 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 28 July 2006 - 07:06 PM

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>

#2 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 28 July 2006 - 07:14 PM

I think your problem is here:
         function openWin(){
         newWin = open("# ","window","height=400  width=400,top=200 left=200");
         newWin.document.open();
         }/* openwindow  */

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

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



#3 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 28 July 2006 - 11:57 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users