Although I’ve never done this, I will have to in the near future so I’ve been watching the thread.
It seems to me that a good way to do this is to break the page into two panels <divs>, the first visible (‘display: block’ – the default) with a message saying ‘Javascript is disabled, please enable it’, and the second invisible (display: none;). On page
load a Javascript function will hide the first panel and show the second.
If there’s no Javascript, the first panel will show. It will not redirect them of course, but the required content can be shown in the first <div> (one less trip to the server).
bpw
Contributor
2258 Points
490 Posts
Re: Check if Javascript is disabled
Sep 30, 2007 03:06 PM|LINK
Although I’ve never done this, I will have to in the near future so I’ve been watching the thread.
It seems to me that a good way to do this is to break the page into two panels <divs>, the first visible (‘display: block’ – the default) with a message saying ‘Javascript is disabled, please enable it’, and the second invisible (display: none;). On page load a Javascript function will hide the first panel and show the second.
document.getElementById("JsWarning").style.display = "none";
document.getElementById("theContent").style.display = "block";
If there’s no Javascript, the first panel will show. It will not redirect them of course, but the required content can be shown in the first <div> (one less trip to the server).
Will this work, or am I missing something?