Javascript examples for jQuery:Document
Call a function inside another function on document load
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(window).load(function(){/* www . j av a2 s .c om*/ function my() { console.log('my second alert') } function test() { console.log('my first alert'); my(); } $(document).ready(function(){ test(); }) }); </script> </head> <body> </body> </html>