Click to See Complete Forum and Search --> : Javascript Turned Off
Gnicki
03-25-2003, 01:24 PM
Forgive me for this question, I'm new at this, but I need to know.
Having finished all of this glorious programming for my site, I wonder... do I have to do a whole new site without JS for people who are surfing with it turned off?
Phil Karras
03-25-2003, 01:35 PM
JS allows use of comment out as in:
<script ...>
<!--
// JavaScript goes here
// -->
</script>
So that browser without JS or with it turned off can ignore the code.
Further, the answer is yes. If you want something that looks OK to come up with minimal usage still there.
You may also want to add that to your pages or write different pages the client can select for non-JS browsers.
JS does make it easy in one respect, you can test for JS, if found go here, otherwise it falls through to the default page, this page.
Last, it all depends on what and who your site is for. If you want to meet the needs of people with no JS or with it turned off then yes you need to do something for them, otherwise no.
Here's a real simple check:
<script ....>
<!--
var Test = 1;
if (Test) {
// go to a different JS supported page set
}
// -->
</script>
<!-- Otherwise we continue with this page set -->
Gnicki
03-25-2003, 01:43 PM
Thank you for responding Phil.
Is there an obvious lag time during the redirection?
Also (sorry if its obvious, but...) where in your script would I indicate the page name (ie page1.html and page1nojs.html)?
Phil Karras
03-25-2003, 02:44 PM
No lag time.
Command to redirect:
document.location.href=
Gnicki
03-25-2003, 03:36 PM
Thanks so much for your help! Much appreciated...