Serve different JS files, depending on browser support?

Juan Ignacio Dopazo dopazo.juan at
Thu Sep 5 07:11:08 PDT 2013

Conditionally loading modules is also built into YUI. For example, when you
want to use JSON, YUI checks if the native version is present and if not it
loads a JS implementation.

You have to do it feature by feature. I recently wrote a Taskjs like
generators+promises implementation and it checks which syntax is supported
(ES6 or the old Firefox one without function*) by using eval() and catching
syntax errors. See It
doesn't load a new module based on that check because the code is not big
enough to warrant loading a whole new script.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list