I'm dynamically creating the contents of my html page, the page includes a link that would pop up a new window without the toolbar and stuffs. I've tried everything to call the pop up window but it kept showing me "Object Expected" error. Any help would be appreciated. Thanks
<script language="javascript">
function testLink()
{
document.open();
document.write('<body bgcolor="#FFFFFF">');
document.write('<table width="100%" border="0" align="center">');
document.write('<tr><td>');
document.write('<a href="javascript:NewWindow(\'deviationFrame.html\', \'deviationFrame\')">');
document.write('POPUP WINDOW</a></td></tr></table></body>');
document.close();
}
function NewWindow(myPage, myName)
{
w = 950
h = 620
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl
+',scrollbars='+no+',resizable'
win = window.open(myPage, myName, winprops)
}
</script>
<body bgcolor="#FFFFFF" text="#000000" onLoad="testLink()">
<form name="form1" method="post" action="">
</form>
</body>
</html>
<script language="javascript">
function testLink()
{
document.open();
document.write('<body bgcolor="#FFFFFF">');
document.write('<table width="100%" border="0" align="center">');
document.write('<tr><td>');
document.write('<a href="javascript:NewWindow(\'deviationFrame.html\', \'deviationFrame\')">');
document.write('POPUP WINDOW</a></td></tr></table></body>');
document.close();
}
function NewWindow(myPage, myName)
{
w = 950
h = 620
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl
+',scrollbars='+no+',resizable'
win = window.open(myPage, myName, winprops)
}
</script>
<body bgcolor="#FFFFFF" text="#000000" onLoad="testLink()">
<form name="form1" method="post" action="">
</form>
</body>
</html>