[2006-04-20] HTML/CSS/JavaScript: Duh!

dorward: Thanks again for your comments. I don't know why it didn't occur to me to use GCC itself as a pre-processor. Some of the simple things I tried out worked well with GCC. I haven't checked out The Dolt yet. As for condition #2 ("JavaScript disabled, Stylesheets enabled") mentioned in my previous post on this topic, I have found a better solution to the distracting "peek-a-boo" effect inherent in my previous solution. In the HEAD of the page, I have now put:

     <script type="text/javascript"><!--       hideHiddenDivs( );     // --></script> 
where hideHiddenDivs() is defined as:
   function hideHiddenDivs( )   {     if( document.getElementById)     {       document.write(         '<style type="text/css"> div.hidden { display: none; } </style>');     }   } 
I could have put this scriptlet inline, but there seems to be a problem with the parser of the W3C validator tool which complains about a "</style>" that does not end a STYLE element.

(Originally posted on Advogato.)

Other Posts from 2006