I have a external test.js file with code:
$(document).ready(function() {
alert("I am an alert box2!");
});
function show_alert()
{
alert("hihi");
}
In my .html, I have included test.js, jquery file and there is a button. When click on it, show_alert() function will be called and it works. However, The message “I am an alert box2!” is not fired.
Also, if I put the document.ready function in my .html with <script>... </script>. It works. What wrong with my code? External file not support?
One of the following: