jquery TP框架實現ajax分頁

2022-09-09 12:57:14 字數 3081 閱讀 9013

html**如下:

>列表

title

>

head

>

<

body

>

<

table

>

<

tr>

<

th>id

th>

<

th>賬號

th>

<

th>密碼

th>

<

th>手機

th>

<

th>郵箱

th>

<

th>位址

th>

tr>

<

foreach

name

="data.data"

item

="v"

>

<

tr id

="t"

>

<

td>

td>

<

td>

td>

<

td>

td>

<

td>

td>

<

td>

td>

<

td>

td>

tr>

foreach

>

table

>

當前第頁/共頁

<

a href

="j**ascript:void(0)"

onclick

="page()"

>首頁

a>

<

a href

="j**ascript:void(0)"

onclick

="page()"

a>

<

a href

="j**ascript:void(0)"

onclick

="page()"

a>

<

a href

="j**ascript:void(0)"

onclick

="page()"

>尾頁

a>

<

script

src="__public__/js/jquery-3.3.1.min.js"

>

script

>

<

script

>

function

page(obj) else if(obj=='prev')else if(obj=='next')else

$.get(

"__url__/index?page="+

obj,

function

(data,status));

}script

>

body

>

html

>

php**如下:

<?php

namespace home\controller;

usethink\controller;

class indexcontroller extends

controller

else

//if($current_page>=$last_count

)else

//返回

$data2['data'] = $data; //

表單資料

$data2['current_page'] = $current_page; //

當前頁$data2['home_page'] = $home_page; //

首頁$data2['last_page'] = $last_page; //

尾頁$data2['pre_page'] = $pre_page; //

$data2['next_page'] = $next_page; //

$this->assign('data',$data2

);

$this->display();

}public

function

getpage()

else

//if($current_page>=$last_count

)else

//返回

$data2['data'] = $data; //

表單資料

$data2['current_page'] = $current_page; //

當前頁$data2['home_page'] = $home_page; //

首頁$data2['last_page'] = $last_page; //

尾頁$data2['pre_page'] = $pre_page; //

$data2['next_page'] = $next_page; //

$this->ajaxreturn($data2,'json');

}}

在Zend Framework 中實現Ajax

開發平台 windows xp sp2 測試平台 freebsd 7.0 開發工具 netbeans 6.1 使用框架 zend framework 1.5.2 資料庫 mysql 5.0.51a 一 表 mysql select from news id title add time 22 rot...

ConvenientBanner框架實現廣告瀏覽

xmlns android id id convenientbanner android layout width match parent android layout height 200dp canloop true 或者 中動態新增 convenientbanner mconvenientb...

實現LAMP框架

綜合實驗 1.二進位制安裝資料庫 192.168.41.102 2.安裝httpd 192.168.41.101 3.安裝frm方式編譯php 192.168.41.101 4.安裝wordpress,discuz 192.168.41.101 5.完成測試 實現多虛擬主機,乙個主機blog.mag...