Pop Up Windows with Javascript
Javascript is the most popular script in website. For now I want to show you how
to use javascript for make pop up windows.
- Write javascript function in the <head> tag
<script type="text/javascript">
<!--
function myPopUp() {
window.open("http://www.ant.com.kh/","myWindow","status=1,height=600,width=800,resizable=0")
}
//- >
</script>
- Call myPopUp() function in HTML
<p onclick="myPopUp()"> CLICK ME</p>
Complete Source Code
<html>
<head>
<script type="text/javascript">
<!--
function myPopUp() {
window.open("http://www.ant.com.kh/","myWindow","status=1,height=600,width=800,resizable=0")
}
//- >
</script>
</head>
<body>
<p onclick="myPopUp()"> CLICK ME</p>
</body>
</html>