Creating a Pop Up Window with Javascript
Here is how to create a simple pop-up window using java script.
This will create a pop-up window on page load:
Place this javascript in the <head> section of the webpage.
View Code JAVASCRIPT
onload = function () { PopUpURL = "page.php"; PopUpLeft = 100; PopUpTop = 100; PopUpWidth = 600; PopUpHeight = 300; popO='left='+PopUpLeft+',top='+PopUpTop+',width='+PopUpWidth+',height='+PopUpHeight window.open(PopUpURL,'nrc',popO); } |
Here is how to create a Pop Up Window from a link:
Place the following code in the <head> section
View Code JAVASCRIPT
var newwindow; function popup(url) { newwindow=window.open(url,'name','height=500,width=333'); if (window.focus) {newwindow.focus()} } |
This part goes in the link tag:
View Code HTML
<a href="javascript:popup('poppedexample.html');">Pop it</a> |




