December 2013
Intermediate to advanced
384 pages
9h 54m
English
var params = [{name:"user",value:"Brad"}, {name:"rating", value:"1"}] $.post("setRating.php", params, myHandler);
Using jQuery to post data to the server is easy with the .post() helper method because .post() handles all the necessary headers in the background. You call the .post(url, params, handler(data)) method and pass in the url to the server location, parameter string, or object. Then you specify a handler to handle the data.
If you pass in an object, it needs to be a list of objects with name and value pairs. For example:
var params = [{name:"user",value:"Brad"}, {name:"rating", value:"1"}] ...
Read now
Unlock full access