jquery Simple Ajax Invocation Example
jquery is really handy, here's a simple Ajax call:
To create a simple HTML file:
<! DOCTYPE html>
OK, click on the button to see the effect.
Of course, jquery's Ajax calls can control a lot of items, and here's a simple call.
Pay attention to your own jquery reference path.
Well, make a call to the background example:
<! DOCTYPE html>
Background code:
<?php $msg = ' Hello, '. $_post[' name ']. ', your '. $_post[' age ']. '! '; Echo $msg;
Now you can get the data from the background!
Of course, we can also invoke Ajax in this way:
<! DOCTYPE html>
Attention
Success:function (data)
The data parameter in the can be changed to a different name, such as Success:function (msg), and MSG for the returned information. Here is the parameter of the callback function, not the
Data: "Name=garfield&age=18"
The data parameter in the AJAX call in the.
jquery Simple Ajax Invocation Example