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
https://forums.phpfreaks.com/topic/15918-javascript-window-help/
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
https://forums.phpfreaks.com/topic/15918-javascript-window-help/#findComment-65354
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
https://forums.phpfreaks.com/topic/15918-javascript-window-help/#findComment-65477
Share on other sites

Archived

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

×
×
  • 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.