Getting null while doing jquery ajax call to read data from database
Hi All,
I am calling jquery-ajax function to read data from database using servlets and display in html page on page load. But in html age, its coming as null.
Code is as below:
$(document).ready(
$.callme = function () {
$.ajax({//create an ajax request to display.php
type: "POST",
url: "ReadDataBaseValue",
dataType: "html", //expect html to be returned
success: function (response) {
$("#anuj1").html(response);
}
});
});
In servlet(servlet url is- "ReadDataBaseValue")
response.getWriter().write(select_query_result);
Kindly suggest how this can be done...