Next page in Sequence

[Total: 0    Average: 0/5]

This example will determine the current page and what the next page should be.

Body Code:

This page is: (pretend) 
<script>
var _thispage = document.location.toString();
    _thispage = "http://www.js-examples.com/1.1.1.html"; // remove this test line
document.write(_thispage);
</script>
<BR><a href="javascript:nextP()">next page</a><BR>
<script>
function nextP() {
  var _l = _thispage;
  var _n = _l.substr(0,_l.indexOf(".html"));
  var _x = _n.substr(0,_n.lastIndexOf("."));
  var _j = _n.substr(_n.lastIndexOf(".")+1,_n.length);
      _j++;
  var _i = _x+"."+_j+".html";
  // remove the comments and the alert statement to use.
  //document.location=_i;
  alert("This would have been the next page visited:n"+_i);
}

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *