Home > Web Front-end > JS Tutorial > jQuery ajax routing and filter usage instructions_jquery

jQuery ajax routing and filter usage instructions_jquery

WBOY
Release: 2016-05-16 18:04:00
Original
1374 people have browsed it

Unfortunately, one legacy system I worked with didn't do this. So I used jQuery's ajaxPrefilter on the client to modify the calling method.

Copy code The code is as follows:



ajaxPrefilter demo







Use comparison
Copy code The code is as follows:

// After transformation
$.post('/ajax/dir/page/action',{page:1})
// Before transformation
$.post('/ajax.php',{
dir : 'dir',
page : 'page',
action : 'action',
args : JSON.stringify( { page:1 })
});
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