我是初学者,我在我的页面上绑定数据滚动它没有网址重写正常工作。
当我在页面上重写我的页面名称数据时,滚动没有加载。
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src='<%=ResolveUrl("../js/jquery-1.4.1.min.js") %>' type="text/javascript"></script> js file refrence
<script type="text/javascript">
var pageIndex = 1;
var pageCount;
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
GetRecords();
}
});
function GetRecords() {
pageIndex++;
if (pageIndex == 2 || pageIndex <= pageCount) {
$("#loader").show();
$.ajax({
type: "POST",
**url: "dashboard/GetCustomers",** Name of Url Rewritted Page.
data: '{pageIndex: ' + pageIndex + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
}
}
function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
pageCount = parseInt(xml.find("PageCount").eq(0).find("PageCount").text());
var customers = xml.find("Customers");
customers.each(function () {
var customer = $(this);
var table = $("#dvCustomers table").eq(0).clone(true);
$(".PopProfilePic", table).html(customer.find("ProfilePic").text());
$(".username", table).html(customer.find("Name").text());
$(".showID", table).html(customer.find("ShowID").text());
$(".userid", table).html(customer.find("UserID").text());
$(".date", table).html(customer.find("CreatedDate").text());
$(".photo", table).html(customer.find("Photo").text());
$(".postal", table).html(customer.find("UserID").text());
$(".country", table).html(customer.find("EmailID").text());
$(".phone", table).html(customer.find("PointStatus").text());
$("#dvCustomers").append(table).append("<br />");
});
$("#loader").hide();
}
</script>
他我的页面的实际名称是UserHome.aspx,我正在将其重写为仪表板 当我使用页面 userhome.aspx / GetCustomer 而不重写url时,它可以正常工作.Pleas纠正我。