Home >Web Front-end >JS Tutorial >jquery framework usage tutorial AJAX_jquery

jquery framework usage tutorial AJAX_jquery

WBOY
WBOYOriginal
2016-05-16 18:44:59998browse

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; ?>
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