Forum Moderators: open

Message Too Old, No Replies

windows.open opens 2 windows whne I want one

         

cletus

6:41 pm on Dec 12, 2003 (gmt 0)



I am trying to open a new window using Javascript but each time it open a full size window that contains the text [object window] and the correct window.

the line I am using is:
href=javascript:window.open(\"$link\", \"smallwin\",\"width=400, height=200,status=yes,resizable=yes\");

I have tried to use the return false attribute but I only get a blank window with that.

Any thoughts?

DrDoc

6:57 pm on Dec 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

We have had quite a few discussions about this in the past, and the general recommendation is to do something like this:

<a href="page.html" target="_blank" onclick="window.open('page.html', 'windowname','width=400, height=200,status=yes,resizable=yes');return false;">Link text</a>

If JavaScript is enabled, the page will open in a new window, according to your specs. If not, it will still open in a new window.