Skip to content

Instantly share code, notes, and snippets.

@kirkbushell
Last active August 29, 2015 13:55
Show Gist options
  • Save kirkbushell/8712761 to your computer and use it in GitHub Desktop.
Save kirkbushell/8712761 to your computer and use it in GitHub Desktop.
var registration = {
create: function() {
var status = null;
var data = {
id: '',
status: ''
};
this.setStatus = function(value) {
data.status = value;
};
this.setId = function(value) {
data.id = value;
};
this.updateStatus = function(url, callback) {
jQuery.ajax({
url: url,
type: 'POST',
data: data,
success: function(data) {
window.location = callback;
}
});
};
},
updateHandler: function() {
var url = jQuery(this).data('url');
var callback = jQuery(this).data('callback');
var status = jQuery(this).data('status');
var id = jQuery(this).data('id');
var temp = new registration.create();
temp.setStatus(status);
temp.setId(id);
temp.updateStatus(url, callback);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment