6 ms·
If you are learning jQuery, then doing AJAX with jQuery is extremely easy. First, you have to learn how code a server side application that send JSON or XML en
by revoltingx 16y ago
If you are learning jQuery, then doing AJAX with jQuery is extremely easy.
First, you have to learn how code a server side application that send JSON or XML encoded data.
Then you can load it with jquery using .ajax like so:
$.ajax({url: 'yoururl.com/script',
data: 'field1': 'myval',
success: function(data)
{
//call to server worked, json/xml has been auto
//inflated into the data object
},
error: function()
{
//the call failed, maybe a 404 or 500 error.
});
That's it! You'll want to then manipulate your DOM accordingly, such as disabling any 'buttons' setting progress status, etc.