Become Joomla Developer

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.
  1. 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> 
    
  2. 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>

Suggestion | Contact US | About US | Term of Use | Privacy Policy | Advertiseing