php?Ajax

WBOY
Release: 2016-06-23 13:22:56
Original
940 people have browsed it


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

改用ajax后
1.传递的标量需要那些
2.触发ajax事件要怎么写(年份单击时写一个,换页时写一个?)
3.拿到的数据怎么替换


回复讨论(解决方案)

使用 jQuery,原有的页面内容并无需改变
引入 jQuery 后,只需添加下面 js 代码即可

$(function() {  $('a').click(function(){    $('body').load(this.href)    return false;  });
Copy after login
Copy after login

使用 jQuery,原有的页面内容并无需改变
引入 jQuery 后,只需添加下面 js 代码即可

$(function() {  $('a').click(function(){    $('body').load(this.href)    return false;  });
Copy after login
Copy after login


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template