glenelkins Posted February 23, 2007 Share Posted February 23, 2007 Hi Say i have a link as such: <a href="#" onclick="window.open ( blablabla);"> how can i make this popup work, without refreshing the webpage that the link is on? This currently will show the popup but also refreshes the current page Quote Link to comment Share on other sites More sharing options...
paul2463 Posted February 23, 2007 Share Posted February 23, 2007 the way I did it was to have a folder with my help files in it, this javascritp function and the call function PopupMe(num){ myleft=(screen.width)?(screen.width-800)/2:100;mytop=(screen.height)?(screen.height-600)/2:100; settings='top=' + mytop + ',left=' + myleft + ',width=500,height=400,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,fullscreen=no, titlebar=no' var address = ""; switch(num) { case 1: address = 'help/comp_admin_help.php'; break; case 2: address = 'help/supp_admin_help.php'; break; case 3: address = 'help/prod_admin_help.php'; break; case 4: address = 'help/ord_admin_help.php'; break; } Login=window.open(address,'Login', settings); Login.focus(); } <a href="javascript:PopupMe(2)"><img src="../images/icons/help.gif" alt="Help Files" width="55" height="55" border="0" /></a> this way it uses javascript to bring the help files into a popup and has no direct input to the page I am on so it does not refresh - hope that helps Quote Link to comment Share on other sites More sharing options...
worldworld Posted February 23, 2007 Share Posted February 23, 2007 Try this : <script language="javascript" type="text/javascript"> <!-- function popitup(url) { newwindow=window.open(url,'name'); if (window.focus) {newwindow.focus()} return false; } // --> </script> Quote Link to comment Share on other sites More sharing options...
nogray Posted February 23, 2007 Share Posted February 23, 2007 You just need to return false in the javascript so the link won't re-load the page <a href="#" onclick="window.open ( blablabla); return false;"> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.