Aim: When html page loads successfully, jquery $(document).ready gets called, then call function defined in external js inside $(document).ready.
Note: jquery lib included
hello.js
function hello(){
alert('hello');
}
index.html
<script src="hello.js"></script>
$(document).ready(function(){
hello();
});
Above code doesn't trigger alert. New to js and jquery. Better solutions are welcomed. Many thanks in advance.
if you have included hello.js in root directory then try to use this syntax: