Detect Javascript
August 26, 2011 Leave a comment
Oh-boy, there are still some paranoid people out here who disable javascript. I can relate to their problem, with all that advertisement, surveys and popups, but still com on,..
Well, i happend to like javascript, it helps me to improve usibaity and surveilens of users activity on my site. So i decided to make a landingpage for the unfortinate javascript-hating users. For that purpose i needed a way to discover if the visitors Javascript was disabeled.. But her’s the thing,.. how do you do it clint-side without javascript (c:
Well it is simple, just use the ‘<noscript>’ tag, as far as i know it is supportet by all of the current browsers. Place your markup inside one of those puppies,.. and you can do pretty much everything you want, like displaying a message
<noscript> <div> <h2>Turn it on</h2> <p>I know you have turned it off, yes i am talking about javascript, turn it on plz.., becouse i want you to (O,~).</p> </div> </noscript>
or a redirect, yes it is possible without javascript (c:
<noscript> <meta http-equiv="REFRESH" content="0; url=http://mysite.net/turniton.aspx"> </noscript>
So no beef there, don’t hate, spread love ..