Error : Uncaught SyntaxError: Unexpected token ;
My Code
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src=" https://code.jquery.com/jquery-3.5.1.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css" />
<script type="text/javascript" src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
<script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="ASPSnippets_Pager.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
GetCustomers(1);
});
$(document).on("click", '.Pager .page', function () {
GetCustomers(parseInt($(this).attr('page')));
});
$(document).on('click', '.view', function () {
$('[id*=hfId]').val($(this).closest('tr').find('td').eq(0).html());
});
$.ajax({
type: "POST",
url: "Default.aspx/GetCustomersDetails",
data: '{empId: ' + id + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var job_material = xml.find("job_material");
var id = $(job_material[0]).find("id").text() ;
var boardname = $(job_material[0]).find("boardname").text();
var materialgsm = $(job_material[0]).find("materialgsm").text();
var materialcode = $(job_material[0]).find("materialcode").text();
var materialwebwidth = $(job_material[0]).find("materialwebwidth").text();
var costpersqmeter = $(job_material[0]).find("costpersqmeter").text();
$("#dialog").dialog({
title: "VIEW MATERIAL DETAILS",
width: 830,
height: 300,
buttons: {
Close: function () {
$(this).dialog('close');
}
},
modal: true
});
$("#dialog").parent().appendTo($("form:first"));
};
$("#dialog1").dialog({
title: "EDIT MATERIAL DETAILS",
width: 830,
height: 300,
buttons: {
Close: function () {
$(this).dialog('close');
}
},
modal: true
});
$("#dialog1").parent().appendTo($("form:first"));
};
return false;
});
var i = 0;
function GetCustomers(pageIndex) {
$.ajax({
type: "POST",
url: "Material.aspx/GetCustomers",
data: '{pageIndex: ' + pageIndex + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
$('[id$=gvDetails]').prepend($("<thead></thead>").append($('[id$=gvDetails]').find("tr:first"))).DataTable().destroy();
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var customers = xml.find("job_material");
var row = $("[id$=gvDetails] tbody tr:last-child").eq(0).clone(true);
$("[id$=gvDetails] tbody tr").not($("[id$=gvDetails] tbody tr:first-child")).remove();
$.each(customers, function () {
$("td", row).eq(0).html($(this).find("id").text());
$("td", row).eq(1).html($(this).find("boardname").text());
$("td", row).eq(2).html($(this).find("materialgsm").text());
$("td", row).eq(3).html($(this).find("materialcode").text());
$("td", row).eq(4).html($(this).find("materialwebwidth").text());
$("td", row).eq(5).html($(this).find("costpersqmeter").text());
$("[id$=gvDetails]").append(row);
row = $("[id$=gvDetails] tbody tr:last-child").eq(0).clone(true);
});
$("[id$=gvDetails] tbody tr:first-child").remove();
if (i != 0) {
$('[id$=gvDetails]').DataTable({
"paging": false,
"info": false
});
} else {
$('[id$=gvDetails]')
.prepend($("<thead></thead>").append($('[id$=gvDetails]').find("tr:first")))
.DataTable({
"paging": false,
"info": false
});
}
i++;
var pager = xml.find("Pager");
$(".Pager").ASPSnippets_Pager({
ActiveCssClass: "current",
PagerCssClass: "pager",
PageIndex: parseInt(pager.find("PageIndex").text()),
PageSize: parseInt(pager.find("PageSize").text()),
RecordCount: parseInt(pager.find("RecordCount").text())
});
},
failure: function (response) {
alert(response.responseText);
},
error: function (response) {
alert(response.responseText);
}
});
}
</script>