robert_gsfame Posted July 17, 2010 Share Posted July 17, 2010 Does every browser support javascript?? i really worry as most of my pages contain javascript.....should i do the checking whether users have enable their javascript once visit my website and give alert or anything else that i can do? need some clue... thx Quote Link to comment https://forums.phpfreaks.com/topic/208001-php-javascript/ Share on other sites More sharing options...
corbin Posted July 17, 2010 Share Posted July 17, 2010 Most people have JavaScript enabled, so I doubt it would be an issue. However, typically one should avoid using JS unless it actually adds a significant amount of user friendliness to a page. Instead of checking if JS is disabled or not, what you would want to do is code your website to work with or without JS, but sometimes that's not an option. I could talk more on this, but I'm feeling quite lazy, so if you don't know what I mean, I'll try to explain more. Quote Link to comment https://forums.phpfreaks.com/topic/208001-php-javascript/#findComment-1087346 Share on other sites More sharing options...
Alex Posted July 17, 2010 Share Posted July 17, 2010 As corbin touched upon, I would avoid using JavaScript in scenarios where the same effects can be reached with other means. There are many basic tasks like image pre-loading, changing images onhover, etc.. that are often done in JavaScript that can all be done through CSS. In those cases it's not necessary to use JavaScript and definitely a better idea to use CSS. Even though the user base that doesn't support JavaScript is fairly small at the time why risk the chance of losing even a single visitor if it's not necessary. But in the more likely case that you're using more involved JavaScript whose effects can't be achieved by other means, it's always a good idea to adhere to the ideas of Graceful Degradation and provide and alternate route to those users who may not support JavaScript. Quote Link to comment https://forums.phpfreaks.com/topic/208001-php-javascript/#findComment-1087360 Share on other sites More sharing options...
Daniel0 Posted July 17, 2010 Share Posted July 17, 2010 But in the more likely case that you're using more involved JavaScript whose effects can't be achieved by other means, it's always a good idea to adhere to the ideas of Graceful Degradation and provide and alternate route to those users who may not support JavaScript. Progressive enhancement is better. That way you don't have to treat anyone as second-class citizens on your website. It's also easier accomplishing, IMO. Quote Link to comment https://forums.phpfreaks.com/topic/208001-php-javascript/#findComment-1087401 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.