简单的ajax分页,不用去php改代码什么的,也不用改自带的分页类,只需要一段简单的js代码
只说思路,明白人一看就明白了。
前提在控制器里用tp的渲染模板函数:fetch();
第一 tp自带的分页 在页面上是不是有链接?直接用js获取分页下a标签的herf,然后用return false ;不让他跳转。
第二,(原生的js,自己想办法)jquery的ajax下 是不是有个参数是url?,然后把获取的a标签url,放进这个参数里。
后台代码$this->assign('invest', $查询的数据);<br>
echo $content=$this->fetch('ajax_xxx'); //渲染的html模板
页面代码<!-- 分页 --><br>
<div>
<br>
{$_page}<br>
</div>
<br>
<script><br />
//get条件查询<br />
$('.page div a').on('click', function() {<br />
var url = $(this).attr('href');<br />
$.get(url, function(data) {<br />
$(".xxxx").html(data);<br />
});<br />
return false;<br />
});<br />
</script>
AD:真正免费,域名+虚机+企业邮箱=0元

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),