<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.9/require.min.js"></script>
<em>Here requriejs is loaded as external resource in jsfiddle</em>
<br/><br/><br/>
<div id="message"></div>
JavaScript
/*!
* author : Deepu Mohan Puthrote
* Copyright 2014, Deepu Mohan Puthrote / http://deepumohan.com/
* Released under the MIT license
*/
requirejs.config({
appDir: ".",
baseUrl: "js",
paths: {
/* Load jquery from cdnjs. On fail, load local file. */
'jquery': ['//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min', 'libs/jquery-min'],
/* Load bootstrap from cdnjs. On fail, load local file. */
'bootstrap': ['//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min', 'libs/bootstrap-min']
},
shim: {
/* Set bootstrap dependencies (just jQuery) */
'bootstrap' : ['jquery']
}
});
require(['jquery', 'bootstrap'], function($) {
console.log("Loaded :)");
$("#message").html('Loaded scripts using requirejs!');
return {};
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.