Home > Web Front-end > JS Tutorial > body text

jquery framework usage tutorial AJAX_jquery

WBOY
Release: 2016-05-16 18:44:59
Original
954 people have browsed it

I tried AJAX for a while and found it to be much simpler than prototype. In JQuery, AJAX has three implementation methods: $.ajax(), $.post, $.get().
XHTML (main):



Enter name:


Enter age:


Enter gender:


Enter job:






JS:
1. Introduce jquery framework:


2. Build AJAX. The advantage of JQUERY is that there is no need to use JS code in XHTML to trigger events. It can be directly encapsulated in JS files:

PHP code:
$arr=$_POST; //If you send data using $.get(), change it to $_GET. Or simply: $_REQUEST
$myjson=json_encode($arr); echo $myjson; ?>
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!