AJax fetch from database to textbox
this code is working on local but when i put it on server den it stop working please help !!!!
<script type="text/javascript">
// calling jquery functions once document is ready
var ff;
$(document).ready(function () {
// retreving data on button click
$("#txtporder").keyup(LoadDataThroughAjaxCall);
//loading screen functionality - this part is additional - start
$("#divTable").ajaxStart(OnAjaxStart);
$("#divTable").ajaxError(OnAjaxError);
$("#divTable").ajaxSuccess(OnAjaxSuccess);
$("#divTable").ajaxStop(OnAjaxStop);
$("#divTable").ajaxComplete(OnAjaxComplete);
//loading screen functionality - this part is additional - end
});
// ajax call
function LoadDataThroughAjaxCall(ff) {
$.ajax({
type: "POST",
url: "orders.aspx/Getdetails",
data: "{'ff':'" + document.getElementById('txtporder').value + "'}",
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: OnSuccess,
failure: OnFailure,
error: OnError
});
// this avoids page refresh on button click
return false;
}
// on sucess get the xml
function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var customers = xml.find("Table");
showOnATable(customers);
}
function showOnATable(customers) {
var headers = [];
var rows = [];
$.each(customers, function () {
var customer = $(this);
$('#txtbstreet').val($(this).find("street").text());
$('#txtbillingcity').val($(this).find("city").text());
$('#txtbillingstate').val($(this).find("state_").text());
$('#txtbillcounty').val($(this).find("country").text());
$('#txtbillingcode').val($(this).find("zip_code").text());
});
var top = "<table class='gridtable'>";
var bottom = "</table>";
var table = top + headers.join("") + rows.join("") + bottom;
$("#divTable").empty();
$("#divTable").html(table);
}
// loading screen functionality functions - this part is additional - start
function OnAjaxStart() {
//debugger;
//alert('Starting...');
$("#divLoading").css("display", "block");
}
function OnFailure(response) {
//debugger;
alert('Failure!!!' + '<br/>' + response.reponseText);
}
function OnError(response) {
//debugger;
var errorText = response.responseText;
alert('Error!!!' + '\n\n' + errorText);
}
function OnAjaxError() {
//debugger;
alert('Error!!!');
}
function OnAjaxSuccess() {
//debugger;
//alert('Sucess!!!');
$("#divLoading").css("display", "none");
}
function OnAjaxStop() {
//debugger;
//alert('Stop!!!');
$("#divLoading").css("display", "none");
}
function OnAjaxComplete() {
//debugger;
//alert('Completed!!!');
$("#divLoading").css("display", "none");
}
// loading screen functionality functions - this part is additional - end
</script>