说明:是HMTL静态的,不是动态页面

解决方案 »

  1.   

    好象一个函数解决不了这个问题.
    给出我的解决方案,希望给楼主一个思路.1.使用类似smarty的模版,生成缓存(包括分页页面也一样缓存)
    2.使用类似apache里的URL改写,使得分页页面变成看起来象静态的样子.
    3.添加一条内容的时候,就把该部分内容的分页页面的缓存删除.(该部分处理的时候,需要把缓存分组,如添加一条新闻,就把新闻的分页缓存删除就可以了)再给出我以前的解决方案.把所有的
    ---
    首页     上一页     ..[1]   [2]   [3]   [4]   [5]   [6]..
    ---
    每个页面都生成静态页.每次添加完所有的内容后,就生成所有添加部分的静态页 
      

  2.   

    静态分页函数是什么函数?按你的说法只有一种:一次性将所有数据取出来!用js将数据读入数组,用dom操作显示!
      

  3.   

    既然是静态还要什么函数?搞不懂,做页面时直接<a herf="...">[1]</a>
    <a herf="...">[2]</a>不就得了。
      

  4.   

    没人理?高手都跑来>>>>>>>>>>>>>>>>>>>>>>>>
      

  5.   

     其实你可以换成另外一种思路,试试,
    在程序中加入特定的字符分解成数据来分页如
    a###b###c
    这样就分成三页了。。
      

  6.   


    给你个客户端分页类 ,你参照下 ,暂不支持 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;
        }
    };