Skip to content

Instantly share code, notes, and snippets.

@agumonkey
Created April 18, 2013 20:53
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 agumonkey/5416133 to your computer and use it in GitHub Desktop.
Save agumonkey/5416133 to your computer and use it in GitHub Desktop.
// table -> [dom]
var lines = jQuery("#gridview-1035 table tr");
// [dom] -> [str]
var parse = function (i,e) {
var s = e.textContent.split(" ");
return s[0] ? s[0].trim() : null; // if (s[0]) { return s[0].trim(); } else return null;
};
files = lines.map(parse);
// [str] -> Array -> text
var style = {
"z-index" : "1000",
"position" : "absolute",
"background-color" : "white",
"width" : "50%",
"overflow" : "scroll",
"height" : "100%"
};
var s = files.toArray().join("\n");
var p = jQuery("<pre>")
.text(s)
.css(style);
// IO
jQuery("body").append(p);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment