function popup(URL,w,h,x,y) { var popupWindow = window.open( 'URL','Name','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y); } getURL("javascript:popup('takemail.php',500,500,0,0)"); changed to : function popup(URL,w,h,x,y) { var popupWindow = window.open(URL,'width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y); // popupWindow.document.write(site); }