For the More Curious: The Webshims Library

As mentioned earlier, one notable browser that does not support the Constraint Validation API is Apple’s Safari browser. Should you need to support Safari, you can use a library, or polyfill, that simulates the API for browsers that do not implement it.

One library that will provide Constraint Validation in Safari is the Webshims Lib, which you can download from github.com/​aFarkas/​webshim.

Actually, the Webshims library can act as a polyfill for many, many features. Setting it up and using it is straightforward. (However, it does do a lot of different things, and it is easy to get lost in the documentation.)

Here is how you use it with CoffeeRun so that Safari works with your Validation ...

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.