Home >Backend Development >PHP Tutorial >php?Ajax,该怎么解决

php?Ajax,该怎么解决

WBOY
WBOYOriginal
2016-06-13 12:27:28803browse

php?Ajax

这一块分页功能已经实现,现在要改用Ajax,不要让页面刷新
之前的做法:

改用ajax后
1.传递的标量需要那些
2.触发ajax事件要怎么写(年份单击时写一个,换页时写一个?)
3.拿到的数据怎么替换
------解决思路----------------------
使用 jQuery,原有的页面内容并无需改变
引入 jQuery 后,只需添加下面 js 代码即可

$(function() {<br />  $('a').click(function(){<br />    $('body').load(this.href)<br />    return false;<br />  });<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn