// plain
A jQuery XMLHttpRequest can be made using the jQuery $.ajax()
method. The $.ajax()
method takes an object as an argument, allowing you to specify the type of request, the URL, and any data to be sent along with the request.
$.ajax({
type: 'GET',
url: '/my/url',
success: function(data) {
console.log('Success!');
}
});
Success!
The type
field specifies the type of request, either GET
or POST
. The url
field specifies the URL of the resource to be requested. The success
field is a function that will be called when the request is successful.
onelinerhub: How can I make a jQuery XMLHttpRequest?