How to Send GET and POST Requests Using jQuery AJAX
AJAX Calls with jQuery
AJAX (Asynchronous JavaScript and XML) is a technique used to make HTTP requests to a server without refreshing the entire web page. This allows for dynamic updates of web pages, making them more responsive and interactive.
Sending GET Requests
To send a GET request using jQuery AJAX, you can use the $.get()
function. The following code demonstrates how to send a GET request with two request parameters (param1
and param2
) to the URL /server-script.php
:
Sending POST Requests
To send a POST request using jQuery AJAX, you can use the $.post()
function. The following code demonstrates how to send a POST request with two request parameters (param1
and param2
) to the URL /server-script.php
:
Comments