View Single Post
  #1 (permalink)  
Old 07-04-2007, 03:01 PM
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 249
paging with JavaScript and ASP "Next" "Previous"

I have a 700 page website paged pg_0001 - pg_0700. And I figure to my knowledge in JavaScript and ASP ( unless you have an easier way ) I want to first read the existing pathname:

Code:
document.write(location.pathname);
Then somehow add +1 ( next page ) to the string or -1 ( previous page )

Code:
	function prevLocation() {
		document.write(location.pathname);
		window.location="pg_0001<%'1%>.asp";
	}
	function nextLocation() {
		document.write(location.pathname);
		window.location="pg_0001<%'1%>.asp";
	}
Code:
<a href="#" onclick="prevLocation();">Previous Page</a>
<a href="#" onclick="nextLocation();">Next Page</a>
Reply With Quote