jQuery Tutorials
jQuery Effects
jQuery HTML
jQuery Traversing
jQuery AJAX
jQuery Misc
The jQuery get () and post () methods are used to request data from the server via an HTTP GET or POST application.
Two commonly used methods for a request-response between a client and server are: GET and POST.
GET is used to retrieve (retrieve) certain data from the server. Note: The GET method may retrieve archived data.
POST can also be used to retrieve certain data from the server. However, the POST NEVER method saves data, and is often used for data transmission and request.
The $.get()
method requests data from the server via the HTTP GET application.
Syntax:
The required URL parameter specifies the URL you wish to request.
Optional call parameter is the name of the job to be performed if the application is successful.
The following example uses the $.get()
method to retrieve data from a server file:
The first $.get()
parameter is the URL we wish to request ("demo_test.asp").
The second parameter is the recurring function. The callback parameter first callsback contains the content of the requested page, and the second callback parameter controls the status of the request.
Tip: Here is what the ASP file looks like ("demo_test.asp"):
The $.post()
method requests data from a server using the HTTP POST application.
Syntax:
The required URL parameter specifies the URL you wish to request.
The data parameter you select specifies the specific data to be sent along with the request.
Optional call parameter is the name of the job to be performed if the application is successful.
The following example uses the $.post()
method to submit specific data and request:
The first $.post()
parameter is the URL we wish to request ("demo_test_post.asp").
Then we transfer some data to send it along with the request (name and city).
ASP text in "demo_test_post.asp" reads the parameters, processes them, and returns the result.
The third parameter is the re-driving function. The first redirect parameter contains the content of the requested page, and the second redirect parameter contains the request status.
Tip: Here is what the ASP file looks like ("demo_test_post.asp"):