Skip to content

Instantly share code, notes, and snippets.

@zer0her0
Created August 25, 2011 21:06
Show Gist options
  • Select an option

  • Save zer0her0/1171953 to your computer and use it in GitHub Desktop.

Select an option

Save zer0her0/1171953 to your computer and use it in GitHub Desktop.
Extension testing...
<script type="text/javascript">
safari.application.addEventListener("command", tableGrab, false);
function tableGrab() {
var iDiv = document.getElementById("reservations");
var iTable = iDiv.getElementsByTagName("table");
var iRows = iDiv.getElementsByTagName("tr");
var iCells = iDiv.getElementsByTagName("td");
var ary = [];
var ary2d = [];
var y = irows.length;
var z = icells.length;
var x = Math.round( z/y );
ary = Array.prototype.slice.call(icells);
for (var i = 0; i < x; i++) {
if (ary2d[i] == null) {
ary2d[i] = [];
}
for (var j = 0; j < y; j++){
ary2d[i][j] = ary[j];
}
}
}
</script>
@larze

larze commented Sep 2, 2011

Copy link
Copy Markdown

Here here! Wish I knew jQuery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment