Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jQuery behavior when JavaScript is disabled

Featured Replies

Hi!

 

I couldn't find any information about this topic in the internet and I really wonder, how come people do not discuss it anywhere?

 

Okay, jQuery works really great and offers many interesting effects, but what if you have JavaScript disabled? I mean I've browsed through several websites powered by jQuery with JS disabled and they doesn't work or behave weird. I know there aren't much people, who disable JS, but well I do want my page to be seen by all people in the end.

 

I managed to do it with slider on my page (however I want to use other jQuery effects), but, for example, http://www.flowplayer.org/tools/index.html doesn't provide any information about this. Try to disable JS and see that nothing works.

 

I can use <noscript></noscript> tag, but I have to make two main pages. And what if I want to view it on one page? What would you do?

 

Regards,

Aleks.

Hi!

 

I couldn't find any information about this topic in the internet and I really wonder, how come people do not discuss it anywhere?

 

Okay, jQuery works really great and offers many interesting effects, but what if you have JavaScript disabled? I mean I've browsed through several websites powered by jQuery with JS disabled and they doesn't work or behave weird. I know there aren't much people, who disable JS, but well I do want my page to be seen by all people in the end.

 

I managed to do it with slider on my page (however I want to use other jQuery effects), but, for example, http://www.flowplayer.org/tools/index.html doesn't provide any information about this. Try to disable JS and see that nothing works.

 

I can use <noscript></noscript> tag, but I have to make two main pages. And what if I want to view it on one page? What would you do?

 

Regards,

Aleks.

 

You should always code so that any Javascript (be it vanilla, jQuery or any other lib) degrades nicely.

 

One way to do so is to code your site in basic XHTML/HTML (obviously semantic) and do ALL styling with CSS (use a framework if you like, I prefer Boilerplate) and then add the bells and whistles over the top.

 

Eg. If your navbar has dropdowns then code and style them as pure CSS dropdowns and then place your jQuery over the top of that and disable the original CSS with jQuery. The outcome:

 

1. User has JS enabled: They see your site in all it's jQuery splendour

2. User had JS disabled: They see the CSS version of your site which looks and acts very similarly to the jQuery alternative, just not quite as slick

 

NB: Obviously, due to the nature of jQuery and the fact that is quite a powerfull framework there are some occassions where you won't be able to offer a non-JS alternative. In these cases I always find a nicely styled notice explaining the reduced functionality to the user and a guide for 'How to Turn Javascript On' works.

  • Author
You should always code so that any Javascript (be it vanilla, jQuery or any other lib) degrades nicely.

 

Absolutely agree. That means I should try to rebuild my website from scratch and then append jQuery, so it works good with both JS enabled and disabled. Thanks for your advices!

Zigactly - for example, if you have some fancy modal popups for forms/links etc - make sure your JS HIJACKS the link's default operation, rather than PROVIDING it. As digilime said, there are some instances where this won't be possible however, and you've just got to let the user know.

 

Regarding sites in the wild, you'll find plenty of commercial sites that FAIL with js turned off. Simply put, it's economic. Graceful degradation can take more work. If you validate, you have to validate server and client side. Try explaining that to a non web-savvy client...they just think you're doing the same job twice. And a large portion of the general public simply don't even know what JS is...let alone how to turn it off.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.