打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
网站真分页js代码该怎么写?
真分页这个词对程序猿们来说,并不是一个陌生的词汇,但是如果你是初次学习真分页,或许还是得花点时间小小研究下,下面是之前去转盘网(喜欢的可以看看,也可以进入引擎模式)的真分页js部分代码,html部分的我就不写了,稍微处理下代码就可以使用的,你也可以根据需要灵活变动,千万不要懒惰哦,废话不说了,直接上代码:
TEL:继本篇之后,以下是其他所有重要的博客,喜欢的可以看看:
中文分词算法 邀请好友注册 数据库备份 ok搜搜爬虫源代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
function get_param(param){ //这个函数是用来获取url的参数的
var query = location.search.substring(1).split('&');
for(var i=0;i<query.length;i++){
var kv = query[i].split('=');
if(kv[0] == param){
return kv[1];
}
}
return null;
}
$("#page_down").unbind().bind('click',function(){ //向下翻页
temp=get_param("currentPage");
if(temp==null || isNaN(temp)){ //非数字或者无页码
toPage=1;
}
else{
toPage=parseInt(temp)+1;
}
ifnull=$("#ifnull").attr("value");
if(ifnull.length<3){
toPage=1;
}
url="${pageContext.request.contextPath }/funnyPic.do?currentPage="+toPage;
window.location.replace(url);
});
$("#home").unbind().bind('click',function(){//回到首页
url="${pageContext.request.contextPath }/funnyPic.do?currentPage=1";
window.location.replace(url);
});
$("#page_up").unbind().bind('click',function(){ //向上翻页
temp=get_param("currentPage");
if(temp==null || isNaN(temp)){ //非数字或者无页码
toPage=1;
}
else{
toPage=parseInt(temp)-1;
}
if(toPage<1){
showMessage("亲~第一页了,真不知道往哪走了");
return;
}
ifnull=$("#ifnull").attr("value");
if(ifnull.length<3){
toPage=1;
}
url="${pageContext.request.contextPath }/index.do?currentPage="+toPage;
window.location.replace(url);
});
$(".turnPage").unbind().bind('click',function(){//翻页部分的代码
toPage=parseInt($(this).text()+"");
ifnull=$("#ifnull").attr("value");
if(ifnull.length<3){
toPage=1;
}
url="${pageContext.request.contextPath }/funnyPic.do?currentPage="+toPage;
window.location.replace(url);
});
本人建个qq群,欢迎大家一起交流技术, 群号:512245829 喜欢微博的朋友关注:转盘娱乐即可。
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
剖析el表达式 (取url地址)
El表达式去作用域的值和用法
手机向下滑动 加载数据
js文件中使用el表达式问题
初涉Ajax
在JSP里使用CKEditor和CKFinder
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服