Professional Documents
Culture Documents
JQuery AJAX Get and Post Methods
JQuery AJAX Get and Post Methods
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT ❯
MYS
jQuery Set
jQuery Add
jQuery Remove
jQuery CSS Classes
jQuery css()
jQuery Dimensions
jQuery Traversing
jQuery - AJAX get() and post()
jQuery Traversing
jQuery Ancestors
Methods
jQuery Descendants
jQuery Siblings ❮ Previous Next ❯
jQuery Filtering
jQuery AJAX The jQuery get() and post() methods are used to request data from the server
with an HTTP GET or POST request.
jQuery AJAX Intro
jQuery Load
jQuery Get/Post
HTTP Request: GET vs. POST
jQuery Misc
Two commonly used methods for a request-response between a client and server
jQuery noConflict()
are: GET and POST.
jQuery Filters
GET - Requests data from a specified resource
jQuery Examples POST - Submits data to be processed to a specified resource
jQuery Examples
jQuery Editor
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp 1/7
30/10/23, 00:52 jQuery AJAX get() and post() Methods
GET is basically used for just getting (retrieving) some data from the server. Note:
Tutorials ExercisesThe Certificates
GET methodmay Services
return cached data. Get Certified Sign Up Log in
The required URL parameter specifies the URL you wish to request.
jQuery AJAX
jQuery AJAX Intro The optional callback parameter is the name of a function to be executed if the
request succeeds.
jQuery Load
jQuery Get/Post
The following example uses the $.get() method to retrieve data from a file on the
server:
jQuery Misc
jQuery noConflict()
jQuery Filters Example
jQuery Examples $("button").click(function(){
jQuery Examples $.get("demo_test.asp", function(data, status){
jQuery Editor
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp 2/7
30/10/23, 00:52 jQuery AJAX get() and post() Methods
jQuery AJAX
jQuery AJAX Intro
jQuery Load
jQuery Misc
The $.post() method requests data from the server using an HTTP POST request.
jQuery noConflict()
jQuery Filters Syntax:
The required URL parameter specifies the URL you wish to request.
Tutorials Exercises Certificates Services Get Certified Sign Up Log in
The optional data parameter specifies some data to send along with the request.
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT ❯
MYS
jQuery Set The optional callback parameter is the name of a function to be executed if the
jQuery Add request succeeds.
jQuery Remove
The following example uses the $.post() method to send some data along with the
jQuery CSS Classes
request:
jQuery css()
jQuery Dimensions
Try it Yourself »
jQuery Misc
jQuery noConflict()
jQuery Filters
The first parameter of $.post() is the URL we wish to request
("demo_test_post.asp").
jQuery Examples
jQuery Examples Then we pass in some data to send along with the request (name and city).
jQuery Editor
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp 4/7
30/10/23, 00:52 jQuery AJAX get() and post() Methods
The ASP script in "demo_test_post.asp" reads the parameters, processes them, and
Tutorials Exercisesreturns
Certificates
a result. Services Get Certified Sign Up Log in
jQuery Examples
jQuery Examples
jQuery Editor
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp 5/7
30/10/23, 00:52 jQuery AJAX get() and post() Methods
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT ❯
MYS
jQuery Set
jQuery Add
jQuery Remove SPACES UPGRADE NEWSLETTER
jQuery Traversing
jQuery Traversing Top Tutorials Top References
jQuery Ancestors
HTML Tutorial HTML Reference
jQuery Descendants CSS Tutorial CSS Reference
JavaScript Tutorial JavaScript Reference
jQuery Siblings How To Tutorial SQL Reference
SQL Tutorial Python Reference
jQuery Filtering Python Tutorial W3.CSS Reference
W3.CSS Tutorial Bootstrap Reference
Bootstrap Tutorial PHP Reference
jQuery AJAX PHP Tutorial HTML Colors
Java Tutorial Java Reference
jQuery AJAX Intro C++ Tutorial Angular Reference
jQuery Tutorial jQuery Reference
jQuery Load
jQuery Get/Post Top Examples Get Certified
HTML Examples HTML Certificate
jQuery Misc CSS Examples
JavaScript Examples
CSS Certificate
JavaScript Certificate
How To Examples Front End Certificate
jQuery noConflict() SQL Examples SQL Certificate
jQuery Filters Python Examples Python Certificate
W3.CSS Examples PHP Certificate
Bootstrap Examples jQuery Certificate
jQuery Examples PHP Examples
Java Examples
Java Certificate
C++ Certificate
XML Examples C# Certificate
jQuery Examples jQuery Examples XML Certificate
jQuery Editor
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp 6/7
30/10/23, 00:52 jQuery AJAX get() and post() Methods
jQuery Traversing
jQuery Traversing
jQuery Ancestors
jQuery Descendants
jQuery Siblings
jQuery Filtering
jQuery AJAX
jQuery AJAX Intro
jQuery Load
jQuery Get/Post
jQuery Misc
jQuery noConflict()
jQuery Filters
jQuery Examples
jQuery Examples
jQuery Editor
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp 7/7