The below code works well on localhost using XAMPP. But it doesn't work on another server.
<!DOCTYPE html>
<html>
<head>
<script src="jquery-latest.js"></script>
</head>
<body>
word: <input type="text" id="sub" />
user: <input type="text" id="user" />
<button type="button" id="btn">Click Me!</button>
<script>
$("#btn").click(function () {
var word=$("#sub").val();
var usr=$("#user").val();
alert("hi");
});
</script>
</body>
</html>
I have got 2 errors from Chrome inspect element:
Uncaught SyntaxError: Unexpected end of input jquery-latest.js:5669Uncaught ReferenceError: $ is not defined
jquery-latest.jsfile is the correct case.