<script type="text/javascript">
var url=location.href,start=1,end=25;//定义开始页和结尾页
var currentPage=parseInt(/\d+/i.exec(url.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")));//获取当前页“码”(数字)
if(currentPage <=start)document.write(' <font color="#666666">首页 上一页 </font>');
else document.write(' <a href="lecon'+start+'.html">首页 </a> <a href="lecon'+(currentPage-1)+'.html">上一页 </a> 当前页:'+currentPage+' ');
if(currentPage>=end)document.write(' <font color="#666666">下一页 尾页 </font>');
else document.write(' <a href="lecon'+(currentPage+1)+'.html">下一页 </a> <a href="lecon'+end+'.html">尾页 </a>');
</script>
var url=location.href,start=1,end=25;//定义开始页和结尾页
var currentPage=parseInt(/\d+/i.exec(url.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")));//获取当前页“码”(数字)
if(currentPage <=start)document.write(' <font color="#666666">首页 上一页 </font>');
else document.write(' <a href="lecon'+start+'.html">首页 </a> <a href="lecon'+(currentPage-1)+'.html">上一页 </a> 当前页:'+currentPage+' ');
if(currentPage>=end)document.write(' <font color="#666666">下一页 尾页 </font>');
else document.write(' <a href="lecon'+(currentPage+1)+'.html">下一页 </a> <a href="lecon'+end+'.html">尾页 </a>');
</script>
解决方案 »
- javascript 不同浏览器支持的问题(求大虾门帮帮忙!急)?
- 怎么用javascript把输入的英文转成数字,求算法
- 请问有谁是过javascript里使用ADO.Recordset 的RecordsetEvent事件,好象javascript里看不见ADO.Recordset 的RecordsetEvent事件
- javascript 设置字体 长度 高度
- 表单提交之前不执行javascript的问题
- 请问怎么样用document来改变form里的内容?
- 如何动态生成一表格,并在其单元格里插入不同的内容
- 如何给body定义事件?
- 关于FORM的一个问题
- 数据类型的问题
- js自动编号并将编号值赋到指定文本框
- js固定比例裁剪缩略图????
var url=location.href,start=1,end=25;//定义开始页和结尾页
var currentPage=parseInt(/\d+/i.exec(url.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")));//获取当前页“码”(数字)
var str="";
if(currentPage <=start)str+=' <font color="#666666">首页 上一页 </font>';
else str+=' <a href="lecon'+start+'.html">首页 </a> <a href="lecon'+(currentPage-1)+'.html">上一页 </a> 当前页:'+currentPage+' ';
if(currentPage>=end)str+=' <font color="#666666">下一页 尾页 </font>';
else str+=' <a href="lecon'+(currentPage+1)+'.html">下一页 </a> <a href="lecon'+end+'.html">尾页 </a>';
document.getElementById(kkk).innerHTML+=str;
}
window.onload=function(){
abc('NAV1');
abc('NAV2');
}
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script language="javascript">
<!--
var url=location.href,start=1,end=25;//定义开始页和结尾页
var currentPage=parseInt(/\d+/i.exec(url.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")));//获取当前页“码”(数字)
function setPage(id){
var str="";if(currentPage <=start)str+=' <font color="#666666">首页 上一页 </font> 当前页:'+currentPage+' ';
else str+=' <a href="lecon'+start+'.html">首页 </a> <a href="lecon'+(currentPage-1)+'.html">上一页 </a> 当前页:'+currentPage+' '; if(currentPage>=end)str+=' <font color="#666666">下一页 尾页 </font>';
else str+=' <a href="lecon'+(currentPage+1)+'.html">下一页 </a> <a href="lecon'+end+'.html">尾页 </a>'; document.getElementById(id).innerHTML+=str;
}
//-->
</script>
</head><body>
<div id=NAV1><script language="javascript">setPage("NAV1")</script></div>
<div id=con style="height:200px;border:1px #aaa solid"></div>
<div id=NAV2><script language="javascript">setPage("NAV2")</script></div><script language="javascript">
</script>
</body></html>