Skip to content

Instantly share code, notes, and snippets.

@stormsson
Last active December 23, 2015 19:19
Show Gist options
  • Save stormsson/6681588 to your computer and use it in GitHub Desktop.
Save stormsson/6681588 to your computer and use it in GitHub Desktop.
JS - Jquery Ajax Updater
jQuery.ajax('http://url.com',{
dataType: 'html',
data: jQuery('#mainform').serialize(),// or array { data1 : 'value1',... }
success: function(data,textStatus,jqXHR)
{
jQuery('#container_to_update').html(data);
},
error: function (jqXHR,textStatus,errorThrown)
{
jQuery('#message_container').html('Si e\' verificato un errore...');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment