惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Palo Alto Networks Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
S
Securelist
酷 壳 – CoolShell
酷 壳 – CoolShell
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cyberwarzone
Cyberwarzone
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
GbyAI
GbyAI
Security Latest
Security Latest
Last Week in AI
Last Week in AI
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
C
Cisco Blogs
博客园 - 【当耐特】
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
B
Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
The Last Watchdog
The Last Watchdog
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
Project Zero
Project Zero
WordPress大学
WordPress大学
L
LINUX DO - 最新话题
F
Fortinet All Blogs
L
LINUX DO - 热门话题
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MongoDB | Blog
MongoDB | Blog
Latest news
Latest news
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
The Hacker News
The Hacker News
爱范儿
爱范儿
O
OpenAI News
J
Java Code Geeks
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - semye

input+select(multiple)实现下拉框输入值 请问做个类似这样的网站多少钱 省份和城市 - semye - 博客园 客户端取用户控件中服务器控件的标识 VS2003调试很慢 enctype="multipart/form-data" 群发邮件太慢了! SQL SERVER “数组参数” WEB水晶报表部署笔记 写程序解智力题,help!!! 低级错误是怎样“炼”成的? SQL语句区分大小写问题 发送邮件 - semye - 博客园 JS事件大全 WinForm动态添加控件及其事件 WinForm程序实现滚动字幕与背景音乐 公历转换为农历 简单水晶报表程序与安装部署文件制作 导数程序
简单的js分页脚本 - semye - 博客园
semye · 2008-04-23 · via 博客园 - semye

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    
<title>无标题页</title>
    
<script language="javascript" type="text/javascript" > 
    
function showpage(url,num,c_p) 
    

        
var prev=0;var next=0;var temp=0;var html="";
        
if(parseInt(c_p+3)>num)
        
{
           prev
=num;
        }

        
else
        
{
            prev
=parseInt(c_p+3);
        }

        temp
=10-(prev-c_p);
        
if(c_p-temp>0)
        
{
            next
=c_p-temp;
        }

        
else
        
{
            next
=1;
        }

        
//如果显示的第一页<10,总页数又大于10
        if(c_p+3<10&&num>c_p+3)
        
{
            
for(j=1;j<=10-(c_p+3);j++)
            
{
                prev
++;
            }

        }

        
if(c_p!=num)
        
{
            html
+="<a href='"+url+"index="+(1+c_p)+"'>上一页</a>"+" ";
        }

        
for (i=prev;i>=next;i--
        

            
if (i==c_p)
            

                html
+="<font color=red>"+i+" </font>";
            }

            
else
            

                html
+="<a href='"+url+"index="+i+"'>"+i+"</a>"+" ";
            }

        }

        
if(c_p!=1)
        
{
            html
+="<a href='"+url+"index="+(c_p-1)+"'>下一页</a>"+" ";
        }

        document.getElementById(
"pagenumber").innerHTML=html+"  转到<input id=\"page\" style=\"width: 33px\" />页 <input type=\"button\" value=\"go\" onclick=\"funcGo()\" />";
    }
 
    
function funcLoad()
    
{
        
var num=100;
        
var url="testpager.html?";
        
var index ;
        index 
= getUrlParam("index");
        
if(index==0)
        
{
            index
=num;
        }

       showpage(url,num,index);
    }

    
function   getUrlParam(name)
    
{   
          
var   reg   =   new   RegExp("(^|&)"+   name   +"=([^&]*)(&|$)");  
          
var   r   =   window.location.search.substr(1).match(reg);   
          
if   (r!=null)   
          
{
              
return parseInt(unescape(r[2])); 
          }

           
return   0;   
    }
 
    
function funcGo()
    
{
            
var num=100;
            
if(parseInt(document.getElementById("page").value)>0&&parseInt(document.getElementById("page").value)<=num)
            
{
                window.location.href
="testpager.html?index="+parseInt(document.getElementById("page").value);
            }

            
else
            
{
                alert(
"页码不存在!");
                
return false;
            }

    }
 
    
    
</script> 
</head>
<body onload="funcLoad(0)">
    
<form id="form1" runat="server">
    
<div id="pagenumber">
    
    
</div>
    
    
</form>
</body>
</html>