Skip to content

Instantly share code, notes, and snippets.

@emamut
Created April 8, 2014 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emamut/10182855 to your computer and use it in GitHub Desktop.
Save emamut/10182855 to your computer and use it in GitHub Desktop.
Ajax request function
function ajax_request(url, data, name) {
$.ajax({
url: site_url + url,
type: 'POST',
data: {id: data},
})
.done(function(response) {
$('.modal-body').empty();
$('.modal-title').empty();
$('.modal-title').html(name + ' horas extra');
$('.modal-body').html(response);
$('#send-form').show();
if(name == 'Detalles')
$('#send-form').hide();
$('#myModal').modal('toggle');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment