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応答で使用すると、ページネーションが機能しません。
私が間違っているところを教えてください。
ありがとうございます。それでは、お元気で