Knowledge Walls
Ammu
Hyderabad, Andhra Pradesh, India
Passcode:
Document in BOM of Javascript 1
1305 Views
Example
<!DOCTYPE html>
    <html lang="en-US">
        <head>
            <meta charset="UTF-8">
            <title>Window</title>
        </head>
        <body>
          
            <button onclick="openw3Schools()">w3Schools</button>
            <button onclick="closew3schools()">closew3schools</button>
            <button onclick="emptywindow()">emptywindow</button>
            <button onclick="movetoknowledgewalls()">movetoknowledgewalls</button>
            <button onclick="takemegoogle()">takemegoogle</button>
               <script>  
                   window.document.write("hello main page")
                   var childwindow;
                   function openw3Schools(){
                       if(childwindow === null || childwindow === undefined)
                           {
                           childwindow=window.open("https://www.w3schools.com");
                           }else{
                           childwindow.focus();
                           }
                            console.log(screen.width);
                            console.log(screen.height);
                            console.log(window.innerHeight);
                            console.log(window.innerWidth);
                   }
                   function emptywindow(){
                       childwindow=window.open("");
                       childwindow.document.write("hello");
                   }
                   function closew3schools(){
                       if(childwindow !== null && childwindow !== undefined)
                        childwindow.close();
                        childwindow = null;
                   }
                   
                    function movetoknowledgewalls(){
                        if(childwindow !== null && childwindow !== undefined)
                        childwindow.location="https://www.knowledgewalls.com";               
                   }
                      function takemegoogle(){
                        window.location="https://www.google.com";            
                   }
                                        

                   
               </script>
        </body>
    </html>
Next Topics
Next lessons of current book.
Previous Topics
Previous lessons of current book.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Best Lessons of "Javascript 1"
Top lessons which are viewed more times.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details