Call function after body onload - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:ready

Description

Call function after body onload

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Test stuff</title> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> 
 </head> //from ww  w  .  j  av a2 s.c  o m
 <body> 
  <script type="text/javascript">
                $( document ).ready(function() {
                        console.log( "ready!" );
                        function initMap() {
                            console.log( "your code here!" );
                            
                        }
                        initMap();
                });
            
      </script>  
 </body>
</html>

Related Tutorials