RequireJS CDN test

Using RequireJS to load from a CDN See http://stackoverflow.com/questions/8070959/sourcing-jquery-from-a-cdn/15641638#15641638

by murrayju

HTML

<script src="http://requirejs.org/docs/release/2.1.5/minified/require.js"></script>
<div id="test">It doesn't work :(</div>

CSS

#test {
    color: red;
}

JavaScript

requirejs.config({
    paths: {
        'jquery': 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min'
    }
});

require(['jquery'], function ($) {
    $(function () {
        $('#test').html('It works!').css('color','green');
    });
});