HTML Conditional Comments

<!--[if lt IE 9]>
<script src="//"></script>

<!--[if gte IE 9]><!-->
<script src="//"></script>


        test: document.addEventListener,
        yep: '//',
        nope: '//'


This will depend on your RequireJS structure, but one way to do this is at the path configuration for jQuery in requirejs.config.

    paths: {
        "jquery": (document.addEventListener) ?

Here is an example RequireJS project with this setup, including the local file fallback.

Another way to do conditional loading with RequireJS is using a loader plugin in conjunction with the map configuration option , though I ran into difficulties getting this setup to work properly.