I'm not sure what you're asking. But if you mean to ask how can I link to my AJAX Pagination page from another page and have it display a specific page, then put this code at the end of your page as shown, just before the closing </body> tag:
Code:
<script type="text/javascript">
/* <![CDATA[ */
(function(instance){
function getQval(n) {
if(typeof n !== 'string'){
return null;
}
var r = new RegExp('[?&;]' + n + '=([^&;#]*)'), m = location.search;
return (m = r.exec(m))? unescape(m[1]) : null;
}
var book = getQval('book');
if(book && (book = window[book]) && typeof book === 'object' && book.pages){
try{instance.refresh(book);} catch(e){}
}
var page = getQval('page');
if(page){
page = --page;
if(!isNaN(page)){
try{instance.selectpage(page);} catch(e){}
}
}
})(mybookinstance);
/* ]]> */
</body>
</html>
Just make sure that the mybookinstance in the above is the name of the variable for your AJAX Pagination instance.
Now, say your page with the AJAX Pagination script on it is called myajax.htm. You can have a link on another page to it like so:
Code:
<a href="myajax.htm?page=2">Open 2nd Page on myajax.htm</a>
If you have other "books", you can select them in a similar fashion:
Code:
<a href="myajax.htm?page=11&book=bookcombo">Open 11th Page of bookcombo on myajax.htm</a>
Be aware that unlike the on page links (javascript:mybookinstance.selectpage(1)) where the number is 0 based, with this method the 0 does nothing, 1 is the first page, 2 is the second, etc.
Bookmarks