高分!求静态新闻列表分页函数!!!!!!!!!!!!!!!!!!! 说明:是HMTL静态的,不是动态页面 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好象一个函数解决不了这个问题.给出我的解决方案,希望给楼主一个思路.1.使用类似smarty的模版,生成缓存(包括分页页面也一样缓存)2.使用类似apache里的URL改写,使得分页页面变成看起来象静态的样子.3.添加一条内容的时候,就把该部分内容的分页页面的缓存删除.(该部分处理的时候,需要把缓存分组,如添加一条新闻,就把新闻的分页缓存删除就可以了)再给出我以前的解决方案.把所有的---首页 上一页 ..[1] [2] [3] [4] [5] [6]..---每个页面都生成静态页.每次添加完所有的内容后,就生成所有添加部分的静态页 静态分页函数是什么函数?按你的说法只有一种:一次性将所有数据取出来!用js将数据读入数组,用dom操作显示! 既然是静态还要什么函数?搞不懂,做页面时直接<a herf="...">[1]</a><a herf="...">[2]</a>不就得了。 没人理?高手都跑来>>>>>>>>>>>>>>>>>>>>>>>> 其实你可以换成另外一种思路,试试,在程序中加入特定的字符分解成数据来分页如a###b###c这样就分成三页了。。 给你个客户端分页类 ,你参照下 ,暂不支持 ajax//客户端分页var currPage = 1;var page = { ListBody:function(){ var obj = null; if($("listBody") != null) { obj = $("listBody"); } else { obj = $("big_listBody"); } return obj; }, disPage:function(){ for(var i=0;i<this.ListBody().childNodes.length-1;i++) { this.ListBody().childNodes(i).style.display = "none"; } }, tab:function(cmd){ if(cmd == "pers") { if(currPage > 1) { this.disPage(); $("list"+(currPage-1)).style.display = ""; currPage--; } } else if(cmd == "next") { if(currPage < this.ListBody().childNodes.length -1) { this.disPage(); $("list"+(currPage+1)).style.display = ""; currPage++; } } $("next").disabled = true; $("pers").disabled = true; if(currPage < this.ListBody().childNodes.length -1) { $("next").disabled = false; } if(currPage > 1) { $("pers").disabled = false; } $("currCount").innerText = currPage; }}; 正则匹配非超链接的url ■■■■■ 请问在这里如何把这个字符串写到一个XML文件当中。■■■■■ 调用百度的popub.js 怎样关闭? 请教正则高手 adodb可否同时连接多个同种数据库? PHP 一般是自己写table还是用table控件 谢谢! phpMyAdmin-2.6-rc1 有问题! 请问如何配着apache做到所有的子目录也解析php? 我從來沒寫過LINUX下的程序,請哪位大俠幫幫忙 php 过滤删除问题 从哪里能搞点免费的php空间。要能用mysql的 fpdf創建問題
给出我的解决方案,希望给楼主一个思路.1.使用类似smarty的模版,生成缓存(包括分页页面也一样缓存)
2.使用类似apache里的URL改写,使得分页页面变成看起来象静态的样子.
3.添加一条内容的时候,就把该部分内容的分页页面的缓存删除.(该部分处理的时候,需要把缓存分组,如添加一条新闻,就把新闻的分页缓存删除就可以了)再给出我以前的解决方案.把所有的
---
首页 上一页 ..[1] [2] [3] [4] [5] [6]..
---
每个页面都生成静态页.每次添加完所有的内容后,就生成所有添加部分的静态页
<a herf="...">[2]</a>不就得了。
在程序中加入特定的字符分解成数据来分页如
a###b###c
这样就分成三页了。。
给你个客户端分页类 ,你参照下 ,暂不支持 ajax
//客户端分页
var currPage = 1;
var page = {
ListBody:function(){
var obj = null;
if($("listBody") != null)
{
obj = $("listBody");
}
else
{
obj = $("big_listBody");
}
return obj;
},
disPage:function(){
for(var i=0;i<this.ListBody().childNodes.length-1;i++)
{
this.ListBody().childNodes(i).style.display = "none";
}
},
tab:function(cmd){
if(cmd == "pers")
{
if(currPage > 1)
{
this.disPage();
$("list"+(currPage-1)).style.display = "";
currPage--;
}
}
else if(cmd == "next")
{
if(currPage < this.ListBody().childNodes.length -1)
{
this.disPage();
$("list"+(currPage+1)).style.display = "";
currPage++;
}
}
$("next").disabled = true;
$("pers").disabled = true;
if(currPage < this.ListBody().childNodes.length -1)
{
$("next").disabled = false;
}
if(currPage > 1)
{
$("pers").disabled = false;
}
$("currCount").innerText = currPage;
}
};