Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $("#export").click(function (event) {
  2. // var outputFile = 'export'
  3. var outputFile = window.prompt("What do you want to name your output file (Note: This won't have any effect on Safari)") || 'export';
  4. outputFile = outputFile.replace('.csv','') + '.csv'
  5.  
  6. // CSV
  7. exportTableToCSV.apply(this, [$('#tablecontainer > table'), outputFile]);
  8.  
  9. // IF CSV, don't do event.preventDefault() or return false
  10. // We actually need this to be a typical hyperlink
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement