医院举办职工代表培训:怎样在HTML用代码实现内容换页

来源:百度文库 编辑:高考问答 时间:2024/05/11 02:53:48

最常见的分页的代码是 :ASP PHP JSP
如果你的静态页面要分页 有一个 方法---JS
HTML上的分页JS代码

<form onsubmit="window.location=this.aaa.options[this.aaa.selectedIndex].value; return false;">
<select name="select" onchange="javascript:window.location.href=this.options[this.selectedIndex].value">

<SCRIPT type=text/javascript>

for(var pN=1;pN<184;pN++)
document.write("<option value='Page_"+pN+".html'>第"+pN+"页</option>");
</SCRIPT>

</select></td></form>

加一个page=8的参数?
然后在for那里再用条件判断??

<form onsubmit="window.location=this.ep8.options[this.ep8.selectedIndex].value; return false;">
<select name="select" onchange="javascript:window.location.href=this.options[this.selectedIndex].value">
<script type="text/javascript">
p=8;
for(var i=1;i<9;i++)
if (i==p){
document.write("<option value='Page_"+p+".html' selected>第"+p+"页</option>");
}
else {
document.write("<option value='Page_"+i+".html'>第"+i+"页</option>");
}
</script>
</select></form>