Open browser pop-up windows by JavaScript

Use this script to open browser pop-up windows when you click a link or an image

The script can position the new window at a given x and y position on the screen, you can specify window width, height and you can specify what other items to apear or to hide on the window (buttons, status bar, etc)

Copy and paste this code in the <head>...</head> area of your code:

  1. <script language="JavaScript" type="text/javascript">
  2. var popUpWin=0;
  3. function popUpWindow(URLStr, left, top, width, height)
  4. {
  5. if(popUpWin)
  6. {
  7. if(!popUpWin.closed) popUpWin.close();
  8. }
  9. popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,
  10. status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+
  11. ',height='+height+',left='+left+', top='+top+',screenX='+left+',
  12. screenY='+top+'');
  13. }
  14. </script>

Then add this code to a normal href link (inside the <a> tag):

  1. onclick="javascript:popUpWindow(
  2. 'http://www.thewebhelp.com','200','200','320','240')"

So that your link looks like this:

  1. <a href="#" onclick="javascript:popUpWindow(
  2. 'http://www.thewebhelp.com','200','200','320','240')">Open a pop-up</a>
Rate this content; the results will appear next to article links in site:
You need flash player