View Full Version : Programming for case: Javascript Disabled
zbattery
10-31-2002, 03:26 PM
What do I have to do to make sure an insert a message for those who do not have Javascript enabled?
Basically I am using a random text script on one section of my site and I'd like to include static text if Javascript is disabled on a users computer.
I appreciate any help.
Bryan Noonan
Webmaster, etc.
http://www.zbattery.com
ConfusedOfLife
10-31-2002, 03:38 PM
You have to put your static message between <noscript> tag, whatever you type there is gonna be shown if the browser doesn't support java script. You also have to put <!-- at the begining of your <script> tag and also --> at the end of your script, something like
<script>
<!-- begin
alert("hello!, your browser supports javascript");
<--
</script>
<noscript>
Your browser doesn't support java script!
</noscript>
Roy Sinclair
10-31-2002, 03:48 PM
Originally posted by ConfusedOfLife
You have to put your static message between <noscript> tag, whatever you type there is gonna be shown if the browser doesn't support java script. You also have to put <!-- at the begining of your <script> tag and also --> at the end of your script, something like
<script>
<!-- begin
alert("hello!, your browser supports javascript");
<--
</script>
<noscript>
Your browser doesn't support java script!
</noscript>
Actually the <#-- and //--> are only required if the browsers expected to be seeing your page don't support javascript at all and haven't been updated to ignore the content of any such tag. In other words don't bother with them, they are no longer needed by anyone who's bothered to update their browser in the last five years.
zbattery
10-31-2002, 04:25 PM
Wow! That is easy and now that you give me the answer I remember seeing it elsewhere.
This is great! I'll be updating the site this afternoon. After that, check out the random content generation. :)
Http://www.zbattery.com
Bryan Noonan
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.