View Full Version : Pagination, question about links inside?

08-30-2008, 10:10 PM
1) Script Title: Ajax Pagination

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex17/ajaxpaginate/

3) Describe problem:
Okay, so im using the pagination script and its working great. Here is my question, in the pages I have loaded, there are links..

so say your on index.php, and im using the pagination to include games.php. if I have a link on games.php, how can I get it to load in the index.php page..

so if I had a link like <a href="?id=2&act=do"></a> on the included page, how can I get it to load as index.php?id=2&act=do

08-31-2008, 05:19 AM
It depends. Is index.php?id=2&act=do a page that's part of a "book" that's already loaded into your content DIV, so all you really want to do is jump to that page using the link, or is that page not part of the existing loaded book?

08-31-2008, 10:22 PM
its not part of the loaded book, basically I have lots of different game pages, with different titles, like tetris.php etc. and you can comment on each game, but the comments are included in a book, on that included page I have links, that i want to load in the current page, not go to a new page.. ie, tetris.php?id=1&act=now instead of includedpage.php?id=1&act=no

09-01-2008, 06:15 AM
Well, generally, to load a new book into the script, you'd call:


On the supplementary page, an example of this is shown:

<div id="paginate-top"> </div>
<div id="pcontent"> </div>
<div id="paginate-bottom"> </div>

<script type="text/javascript">

var bookonflowers={
pages: ["demofiles/flower.htm", "demofiles/flower2.htm", "demofiles/flower3.htm", "demofiles/flower4.htm"],
selectedpage: 0 //set page shown by default (0=1st page)

var bookonanimals={
pages: ["demofiles/external.htm", "demofiles/external2.htm", "demofiles/external3.htm"],
selectedpage: 0 //set page shown by default (0=1st page)

var demo=new ajaxpageclass.createBook(bookonflowers, "pcontent", ["paginate-top", "paginate-bottom"])


<a href="javascript:demo.refresh(bookonanimals)">Load Book on Animals instead</a><br />