student101
02-09-2009, 08:08 AM
1) Script Title: Ajax Pagination script v1.2.2
2) Script URL (on DD): Ajax Pagination script v1.2.2 (http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm)
3) Describe problem:
I'm trying the MySql Method, the page only has numbers with the word next
The MySql used:
<div id="paginate-top"> </div>
<div id="bookdiv"> </div>
<div id="paginate-bottom"> </div>
<script type="text/javascript">
<?php
echo "var commentsbook={\n"; //Dynamically output javascript variable
$commentids=mysql_query("select * from tblprojects"); //get IDs to last 5 comment pages
$idarray=array();
while ($theid=mysql_fetch_array($commentids)){
array_push($idarray, "'demo.php?id=" . $theid[serviceid] . "'");
}
echo "pages: [" . implode(",", $idarray) . "],\n"; //output: pages: [filepath1, filepath2, filepath3, etc],
echo "selectedpage: 2\n}";
?>
var comments=new ajaxpageclass.createBook(commentsbook, "bookdiv", ["paginate-top", "paginate-bottom"])
</script>
Have I missed something in the code? are the ID's wrong? the URL wrong?
How exactly does the data get displayed when there isn't any?
I know of jah(url,target) { the data that needs to be loaded is in the database not a page.html
Solved!
<script type="text/javascript" src="js/jah.js"></script>
<script type="text/javascript" >
window.onload=function(){
jah('prolist.php?pageNum_rsprojects=0','prolist');
}
</script>
2) Script URL (on DD): Ajax Pagination script v1.2.2 (http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm)
3) Describe problem:
I'm trying the MySql Method, the page only has numbers with the word next
The MySql used:
<div id="paginate-top"> </div>
<div id="bookdiv"> </div>
<div id="paginate-bottom"> </div>
<script type="text/javascript">
<?php
echo "var commentsbook={\n"; //Dynamically output javascript variable
$commentids=mysql_query("select * from tblprojects"); //get IDs to last 5 comment pages
$idarray=array();
while ($theid=mysql_fetch_array($commentids)){
array_push($idarray, "'demo.php?id=" . $theid[serviceid] . "'");
}
echo "pages: [" . implode(",", $idarray) . "],\n"; //output: pages: [filepath1, filepath2, filepath3, etc],
echo "selectedpage: 2\n}";
?>
var comments=new ajaxpageclass.createBook(commentsbook, "bookdiv", ["paginate-top", "paginate-bottom"])
</script>
Have I missed something in the code? are the ID's wrong? the URL wrong?
How exactly does the data get displayed when there isn't any?
I know of jah(url,target) { the data that needs to be loaded is in the database not a page.html
Solved!
<script type="text/javascript" src="js/jah.js"></script>
<script type="text/javascript" >
window.onload=function(){
jah('prolist.php?pageNum_rsprojects=0','prolist');
}
</script>