Your script can also be modified or have specific facilities disabled. Always remember that users are in control: it’s their device and connection. They choose to visit your site and can omit anything they don’t want.
- the HTTP request fails
- the request did not complete
- a firewall blocked the response
- the service provider blocked or modified the script
- a browser plugin intercepted or modified the script
- the browser didn’t support the code or facilities you require
- another script raises an error which stops all scripts executing
These issues are especially prevalent in the mobile world where a user could be travelling, using a less powerful device, connecting via a slow network, using flaky airport wifi, etc.
- avoid running code which would result in an error, or
- load polyfills which implement identical functionality.
Users can receive a different experience. Those using the latest Chrome on a desktop may get the highest level of functionality. Those running Opera Mini on a two year-old mobile may receive a basic styled page. Importantly, everyone receives somethingand the site/app remains usable for everyone.
Is Progressive Enhancement Worth the Effort?
That’s a decision for you and the application you’re building.
Progressive Enhancement makes sense for content sites and online stores which need to reach the widest possible audience. When implemented well, it incurs little development overhead and can save time. You know all browsers will continue to render your site regardless of updates they receive in the past, present or future.
Simpler applications may also benefit. An app which posts messages to a social network requires little more than an HTML5 form and some back-end processing. Progressive Enhancement then improves the experience by removing the page refresh, adding styles, implementing input validation, providing a character count, handling errors, making it work offline and more.