Here's a very simple script I wrote that some of you may find useful...

Javascript snippet that will hide all elements that appear before this code.

<div id="myHeader"></div>
<script>
<!--
b = document.getElementById("myHeader");
if (b) {
     o = b.previousSibling
     while (o) {
        if (o.style) {
             o.style.display = "none";
        }
        o = o.previousSibling;        
     }
} 
// -->
</script>
Here's another one... Javascript snippet that will hide tables that have table headings that contain a certain sequence of characters. The code hides table with the heading "Table Title", but you can just change that to whatever title you want. Of course, you can hide more than one table.

<script>
<!--
function hideTable(tables, title)
{
     var rexp = new RegExp(title);
     for (var i = 0; i < tables.length; i ++) {
          var ths = tables.item(i).getElementsByTagName("th");
          if (ths.length > 0) {
               var th = ths.item(0);
               if (th.innerHTML.search(rexp) > 0) {
                    tables.item(i).style.display = "none";
              }
          }
      }
}

window.onload = function() {
     var tables = document.getElementsByTagName("table");
     hideTable(tables, "Table Title");
}
// -->
</script>

Provided as is, without any implied warranties. :)


back to the list of latest entries


i like .. i like!!! (578)

VTouch - 2/21/2003 3:04:00 PM [ 128.2.121.130 ]


Name
Email
Homepage
Comment
Remember my information