Created
February 27, 2013 15:15
-
-
Save basememara/5048648 to your computer and use it in GitHub Desktop.
Revisions
-
basememara created this gist
Feb 27, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ ;(function () { var paths = { ... }; //HANDLE JQUERY IF LOADED ALREADY TO AVOID OVERWRITING EXISTING JQUERY PROPERTIES AND PLUGINS //CHECK FOR OLD VERSIONS OF JQUERY var oldjQuery = !!(window.jQuery && !!window.jQuery.fn.jquery.match(/^1\.[0-4]/)); //LOAD JQUERY IF NOT AVAILABLE OR BELOW MIN if (!window.jQuery || oldjQuery) { paths.jquery = [ '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min', //If the CDN location fails, load from this location 'libs/jquery/jquery.min' ]; } else { //REGISTER THE CURRENT JQUERY define('jquery', [], function () { return window.jQuery; }); } //CONFIGURE REQUIRE JS require.config({ ... paths: paths, ... }); //START REQUIRE JS require([ 'jquery', 'app' ], function ($, App) { //HANDLE MULTIPLE JQUERY VERSIONS IF NECESSARY if (oldjQuery) $.noConflict(true); //INITIALIZE APP App.init(); }); })();