$(document).on("ready", function() {
alert("hello");
});
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="js/jquery-2.1.4.min.js" type="text/javascript" defer></script>
<script src="test.js" type="text/javascript" defer></script>
</head>
<body>
<h3>Hello world!</h3>
</body>
</html>