Click to See Complete Forum and Search --> : [object] error on opening new window


vayumahesh
06-25-2003, 07:57 AM
Hello,

I have the following piece of code to open a new window and is giving me an [object] error on the parent window.

<Script language = "JavaScript">
window.location.href = "javascript:Window.open('files/index.html','Method','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width= 760,height=390,left=100,top=200');"
</script>

The above code is opening up a new window as specified, but it is overwriting the parent page with [object]. I could not figure out the reason for the error. If anyone can please help, I would highly appreciate it.

Thanks ,
VMRao.;)

pyro
06-25-2003, 08:13 AM
You have a few problems...

The reason it is overwriting your current page with [object] is because of this: window.location.href...

To open a new window:

<script type="text/javascript">
window.open("pagetopen.htm","winname","width=400,height=300,etc");
</script>

vayumahesh
06-25-2003, 08:23 AM
I tried that. I am getting an error as 'window' is Undefined.

<script language = "JavaScript" type="text/javascript">
Window.open("files/index.html","Method","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=760,height=390,left=10 0,top=200");
</script>

Thanks,
VMRao.

pyro
06-25-2003, 08:27 AM
window.open is all lowercase.

Gopinath
06-25-2003, 08:31 AM
u want code for ie or nn

pyro
06-25-2003, 08:33 AM
window.open will work in both, if it is used correctly.

vayumahesh
06-25-2003, 09:03 AM
Thanks. That worked.

VMRao

pyro
06-25-2003, 09:06 AM
You're welcome. :)