User:Jgjake2/global.js

function sortTableByDefault2{ var $sortableTables = $(".sortByDefault"); $sortableTables.each( function(i) {

/*       var sortableTables_th = $(this).children("th")[0]; alert(sortableTables_th); var sortableTables_sortHeader = $(sortableTables_th).children(".sortheader")[0]; //alert(sortableTables_sortHeader); //$(sortableTables_sortHeader).click; //ts_resortTable(this);return false; ts_resortTable(sortableTables_sortHeader); */       var sortableTables_th = $sortableTables[i].getElementsByTagName( "th" )[0]; var sortableTables_sortHeader = getElementsByClass2(sortableTables_th, 'a', 'sortheader')[0]; $(sortableTables_sortHeader ).click(function { alert('Handler for .click called.'); }); $(sortableTables_sortHeader).click; }); } addOnloadHook( sortTableByDefault2 );