posted 17 years ago
The solution: <noscript> and <meta> tags.
I place the following in the HTML Head Content (inside the <head> tag for you web-heads out there that, like me, hand-write your own DHTML!):
<noscript>
<meta http-equiv="refresh" content="0;url=status.html">
</noscript>
The <noscript> tag, as per W3Schools.com is described below:
"The noscript element is used to define an alternate content (text) if a script is NOT executed.
This tag is used for browsers that recognizes the <script> tag, but does not support the script in it."
So what we're doing here is redirecting the user agent based on their ability to recognize the <script> tag, but failure to do anything about it (due to, for example, the user agents lack of functionality which you'll find in some WAP/Mobile browsers, or a very capable user agent with Javascript disabled).
As for the destination (read: now that I know you can't use my beautiful UI, where do I send you?!), this is where Google and I part company. Google Maps simply redirects to a page that tells the user that their browser is not currently supported - which IMHO will only confuse the user, as if they only disabled Javascript on their browser, they're likely to find their browser amongst the "Support Browsers" listing. No, I recommend a modification of another method I talked about a while back: An Attempt at Dynamic Content via Javascript
Using this method, you can have your application redirect to status.html with various "status codes", yielding various dynamic/context-sensitive messages to the user agent. Of course, this heavily utilizes Javascript, but you can display the following as the default content in your status.html:
If Javascript is disabled or otherwise not available, the innerHTML of the content container is not changed, and therefore this message is displayed to the user and becomes a reliable redirect/status/landing area for your web-based applications!
<a href="http://www.java-tips.org/java-tutorials/tutorials/" target="_blank" rel="nofollow">Java Tutorials</a> | <a href="http://www.planet-java.org" target="_blank" rel="nofollow">Java Weblog</a> | <a href="http://computer-engineering.science-tips.org" target="_blank" rel="nofollow">Computing Articles</a>