User:Iritscen/TestSpace.js: Difference between revisions

now that I am in my test space, I can spam it up with alerts
(testing sortable table script)
(now that I am in my test space, I can spam it up with alerts)
Line 10: Line 10:
   var divs = document.getElementsByTagName("div");
   var divs = document.getElementsByTagName("div");
   if (!divs) continue;
   if (!divs) continue;
  alert("Checking for sortable table.");
   for (var i = 0; i < divs.length; i++)
   for (var i = 0; i < divs.length; i++)
   {
   {
Line 15: Line 16:
       var tables = theDiv.getElementsByTagName("table");
       var tables = theDiv.getElementsByTagName("table");
       if (!tables) continue;
       if (!tables) continue;
      alert("Found a table.");
       for (var j = 0; j < tables.length; j++)
       for (var j = 0; j < tables.length; j++)
       {
       {
Line 21: Line 23:
         if (hasClass(theTable, "sortable"))
         if (hasClass(theTable, "sortable"))
         {
         {
             alert("Found one.");
             alert("Found a sortable one.");
             // ...Look for sort button
             // ...Look for sort button
             var allTHs = theTable.getElementsByTagName("th");
             var allTHs = theTable.getElementsByTagName("th");