I’m making a small script with show more button at the last of showing 10 entries.
This is the code
<div id="more<?=$lastid;?>">
<a onclick="showmore(<?=$lastid;?>);">More</a>
</div>
and the script is
function showmore(lastid) {
$.post("/ajax/showmore.php", {
lastid: lastid,
}, function(response) {
$("#more" + lastid).show();
setTimeout("finishAjax('more' + lastid, '" + escape(response) + "')", 300);
});
return false;
}
function finishAjax(a, b) {
$("#" + a).html(unescape(b));
$("#" + a).fadeIn(1e3)
}
but the script doesn’t work ? what is the problem here ?
I tested the script with a constant div id and it run good but when I added the $lastid for the div and $(“#more” + lastid) on the script side it doesn’t work
any idea to make the DIV ID changeable ?
thanks in advance
Thank You All
I found the error
it was in this line
I correct it to
Thanks for your answers