我为我的城市选项卡创建了 ajax 代码,以显示来自 ajax 的各个城市数据。
我使用了以下代码:
function showBrandData(str)
document.getElementById("dvloader").style.display = 'block';
jQuery('#txtDisplayBrands').slideDown("slow");
if (str=="")
{
document.getElementById("txtDisplayBrands").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("dvloader").style.display = 'none';
document.getElementById("txtDisplayBrands").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://localhost/demostore/getBrandData.php?q="+str+"&page=1",true);
xmlhttp.send();
}
以下是我加载以上 ajax 内容的 div
<!-- div to display brands products -->
<div id="txtDisplayBrands"></div>
现在我使用以下 jquery 插件对我的项目进行分页 http://cssglobe.com/post/9801/easy-paginate-jquery-plugin-for-pagination
但是当我在我的 ajax 响应中使用它时,分页不起作用。
你能帮我看看我做错了什么吗?
感谢和问候