Skip to content

Instantly share code, notes, and snippets.

@psdtohtml5
Created July 13, 2013 19:31
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 psdtohtml5/5991935 to your computer and use it in GitHub Desktop.
Save psdtohtml5/5991935 to your computer and use it in GitHub Desktop.
JavaScript : Create CSV File
var fullList = [];
$(".list-wrapper").each(function() {
var tempStr = "";
tempStr = '"' + $(this).find(".company-list-name a").text() + '"';
tempStr += ',"' + $(this).find(".profile-update").text() + '"';
tempStr += ',"' + $(this).find(".company-focus").text() + '"';
fullList.push(tempStr);
});
var output = fullList.join('\n');
var uri = 'data:application/csv;charset=UTF-8,' + encodeURIComponent(output);
window.open(uri);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment