Skip to content

Instantly share code, notes, and snippets.

@csarcom
Created November 1, 2012 19:19
Show Gist options
  • Save csarcom/3995829 to your computer and use it in GitHub Desktop.
Save csarcom/3995829 to your computer and use it in GitHub Desktop.
ajax
Billing.getCsv = function() {
var self = this;
// Take care of the url
var url = this.options.csv_serviceUrl;
url = url.replace('?from_date', this.$dateFrom.attr('data-value'));
url = url.replace('?to_date', this.$dateTo.attr('data-value'));
$.ajax({
url: url,
type: 'GET',
data: self.serviceParms,
dataType: 'text/csv',
beforeSend: function() {
self.$noData.hide();
self.$loading.show();
},
success: function(data) {
self.$loading.hide();
self.$csv.show();
//alert(data);
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment