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.

if JS is disabled use this stylesheet.

Featured Replies

Coding a website up that is Js heavy(used for animations of content boxes), and i was wondering if there is a way to in the case if someone has JS disabled, gracefully degradation will kick in and make the site appear to the user just without the whiz bang and pop.

 

Two solutions i have come up with so far are to,

  1. rebuild the mark-up and CSS as it would appear without JS
  2. Then add JS to make it have all the fancy stuff

Second method

  1. Have an id or class on the body element by default and use this as a base to style a no JS version and if JS is enabled, remove or change this ID to show the JS script you can run.

Just wondering if anyone else has come across this problem before and how they have tackled it.

 

Thanks in advanced!

 

Ben

A pretty common tactic that's around these days is the change the class on the <html> element:

 

<!-- In your HTML -->
<html class="no-js">

// In your Javascript
document.documentElement.className = 'js';

Now any rule that starts with .no-js won't be seen if the user has Javascript enabled

Two words; Progressive enhancement

 

Javascript should be used to enhance the user experience, with very few exceptions, if your site is broken without it then you aren't doing it right. Sorry if this sounds a bit hardline, but method 1 is the only sensible approach.

 

p.s. You know you can animate stuff with css too right?

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.