homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
popup problem
flashmastermak




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

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?

 

mozopera




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

Shouldn't it be return true?

flashmastermak




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

Hi Mozopera

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

ShawnR




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

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>

Shawn

flashmastermak




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

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");
remote.moveTo(0,0);
remote.resizeTo(sw,sh);
}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved