nevynev Posted August 9, 2007 Share Posted August 9, 2007 Hi there, I know I should code a side to allow non javascript users to be able to use a site but Im in a rush to build a site. Could someone write me a bit of code which will test to see if a user has javascript off and if so redirects the to e.g. howtoturnonjavascript.php ? Incedentally - what percentage of users accessing a social networking site are likely to have Javascript turned off? Thanks NevyNev Link to comment https://forums.phpfreaks.com/topic/64160-how-to-test-to-see-if-javascript-is-turned-off/ Share on other sites More sharing options...
php_tom Posted August 10, 2007 Share Posted August 10, 2007 Actually, you can test for JavaScript in the browser (not server-side) <html> <body> <script type='text/javascript'> window.location.href='javascriptEnabled.html'; </script> <noscript> <meta HTTP-EQUIV="REFRESH" content="0; url=javascriptNotEnabled.html"> </noscript> </body> </html> http://www.w3schools.com/browsers/browsers_stats.asp (w3schools) reports that in January, 94% of visitors to their site had JavaScript enabled. That figure might be a bit off, since it's a web developers' website, but I figure its close... maybe 90% of typical web users have JS. Hope that helps. Link to comment https://forums.phpfreaks.com/topic/64160-how-to-test-to-see-if-javascript-is-turned-off/#findComment-319842 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.