PDA

View Full Version : Detecting if DHTML is blocked



uglyfatjoe
07-31-2005, 06:46 PM
Is there a DD code (or any suggestions if DD does not have one) to detect if a persons browser has dhtml scripting blocked? I would like to be able to detect this situation and then toggle a graphic at the top of my page asking the user to allow blocked content.

jscheuer1
07-31-2005, 07:27 PM
That is what the <noscript></noscript> tag is for. To do what I think you are proposing, you would use it with a small script. This goes in the body of the page at the spot where you want it to appear:

<noscript><img src="noactive.jpg"></noscript>
<script>document.write('<img src="active.jpg">')</script>The only other thing you need are the two images. They can be whatever you make them to be.

uglyfatjoe
07-31-2005, 09:49 PM
Yes this worked. I feel dumb that this was so simple. Thanks jscheuer1 for the detailed response.