This is my 1st html code:
<form action = "indextable.html" method="GET" >
<p><input name = "ManagerId" class="form-control" id="ManagerId" type
="text" autocomplete="off" onkeyup="alphanumOnly(this)" maxlength="8"
placeholder="ManagerId"></input></p>
<p> <input type="submit" onclick ='return getRepoCount();'
value="submit">Submit</body></p>
</form>
<script>
function alphanumOnly(input){
var regex = /[^a-zA-Z0-9]/gi;
input.value = input.value.replace(regex, "");
}
function getRepoCount(){
var empid = document.getElementById("ManagerId").value;
alert(empid);
$.ajax({
url:'http://localhost:8088/JirasTrackingApp/reporter/
Reportees/ReporteeList/'+ empid,
type:'GET',
dataType: 'json',
success: function(result){
alert('hi');
return true;
},
error:function(result){
alert("Please enter an valid input");
return false;
}
});
}
</script>
Here I am not able to make an ajax call.As when I run the program it displays the empid alert.But the alerts which are in success and error doesn't get displayed.Like it is not making an ajax call only.Please advise where I am going wrong.