Serve different JS files, depending on browser support?

Axel Rauschmayer axel at rauschma.de
Thu Sep 5 04:27:59 PDT 2013


In principle, you could serve different files to different browsers:

– Browser supports ES6 => serve an ES6 .js file
– Otherwise => compile ES6 to ES5 (or ES3)

What is the best way to do this?

– Browsers tell servers their level of ECMAScript support?
– You can do a feature detection in JS and then load modules conditionally? But that seems like a more complicated solution. I’m not even sure how I would implement the detection part.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130905/6a944746/attachment.html>


More information about the es-discuss mailing list