Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

popup problem



4:10 am on Apr 28, 2003 (gmt 0)

10+ Year Member

I'm using the following to open a new window, with the intention of providing a backup link should java be switched off or a popup blocker be present

<a href="pagename.html" onClick="openpopup();return false;">link </a>

the popup script is located in a seperate .js file and it works fine, in-so-much as it launches a new window, however in IE6 running on a windows machine, the new page is also loading in the main browser.

it doesn't happen on my mac

Is there something I don't know?


4:53 am on Apr 28, 2003 (gmt 0)

10+ Year Member

Shouldn't it be return true?


4:56 am on Apr 28, 2003 (gmt 0)

10+ Year Member

Hi Mozopera

I'm sure it should be 'false', althought I've tried it as 'true' and the same thing happens


6:01 am on Apr 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Yes it should definately be 'return false;' to stop further processing. Can't really see anything wrong. I use pretty much the same code and it works fine. Only things I can see different are:
  • try a space between the two statements, after the ';',
  • try declare the language you are using.
  • onclick instead of onClick

I would not have thought any of those would cause problems, but you caould try them. i.e.

<a href="pagename.html" onclick="javascript:openpopup(); return false;">link </a>



2:12 pm on Apr 28, 2003 (gmt 0)

10+ Year Member

I'm guessing that the problem must be with my popup script, which has a resize function, it works a treat but could it be canceling out the return false statement?

function openpopup(){
var sw = (screen.width - 10);
var sh = (screen.height);

remote = window.open("pagename.html","pagename","toolbar=no,resizable=yes,status=no,scrollbars=no,menubar=no");


Featured Threads

Hot Threads This Week

Hot Threads This Month