I have written a basic Hello World application using jQuery in an HTML page in eclipse.
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.3.1.min.js" ></script>
<script type="text/javascript" >
window.onload = function (){
alert("Window loaded");
}
$(document).ready(function(){
alert("DOM loaded");
})
</script>
</head>
<body>
<p>Hello </p>
</body>
</html>`
I have used JRE 8 in eclipse. Upon running it on Chrome, "Window loaded" alert box displays first and then "DOM loaded". Ideally it should be opposite. DOM should load first. DOM loads first if refernece jQuery library from google APIs.
Could anybody help me on this? The question is not about the comparison between the two.