<script src="jquery.js"></script>
<html>
<head>
<meta charset="UTF-8">
<!--<script type="text/javascript" charset="UTF-8" src="jquery.js"></script>-->
<script type="text/javascript">
function sendd() {
var firstname = $("#firstname").val();
var lastname = $("#lastname").val();
if ($.trim(firstname).length > 0 & $.trim(lastname).length > 0) {
$.ajax({
type: "POST", //Request type
url: "http: /localhost/firstname.php",
data: {
firstname: firstname,
lastname: lastname
},
cache: false,
success: function(data) {
alert(data);
}
})
} else {
alert("Input fields are empty");
}
}
</script>
</head>
<body>
<input type=”text” placeholder=”write your first name” id=”firstname”>
<input type=”text” placeholder=”write your last name” id=”lastname”>
<button id="sub" onclick="sendd()">Submit result</button>
</body>
</html>
error:
GET file:///C:/Users/kalat/Documents/random%20projects%20c++%20or%20py%20or%20phpor%20html%20or%20css/android/Hello/www/jquery.js net::ERR_FILE_NOT_FOUND