Jump to content

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/208001-php-javascript/#findComment-1087346
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/208001-php-javascript/#findComment-1087360
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/208001-php-javascript/#findComment-1087401
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.