This is my Jquery script
$(document).ready(function() {
$('#form').submit(function() {
var number = $('#number').val();
$.ajax({
type: "post",
url: "CALCULATE.JSP",
dataType: "text",
success: function(msg) {
alert(msg);
}
});
return false;
});
});
The issue is that , i am getting the whole HTML content as rsponse instead of a number i am printing on the screen
Please see the output sample here
The issue is not a jQuery issue, it is an issue with the server setup. It seems the server is not executing the code, but serving it as text instead. You should ask a question on ServerFault and give them details of the server script.
Also, you can test this without the jQuery, by visiting your url (CALCULATE.JSP) from a web browser and view source. You can then see what the server is outputting, when this is corrected, you can move onto testing within jQuery.