Responsible JavaScript

Responsible JavaScript

Jeremy Wagner

differential serving by relying on two standardized behaviors: Browsers won’t download scripts with type attribute values they don’t recognize. In this case, modern browsers will download scripts served with a type attribute value of modern, but legacy browsers won’t. Inversely, legacy browsers don’t recognize the nomodule attribute, so they’ll download scripts that use it. However, modern browsers do recognize nomodule, so they’ll skip scripts with that attribute. Even so, some browsers don’t get this pattern right. Some browsers have issues where both bundles are downloaded. Some even execute both bundles (http://bkaprt.com/rjs39/05-26).
2743-2752