Cutting the Mustard: Conditionally Load JavaScript in Modern Browsers

(function() {
    var linkEl = document.getElementById('mustardcut');
    if (window.matchMedia && window.matchMedia(linkEl.media).matches) {
        var script = document.createElement('script');
        script.src = 'your-script.js';
        script.async = true;
        document.body.appendChild(script);
    }
})();

Source