-
-
Save christopherliu/6454758 to your computer and use it in GitHub Desktop.
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 characters
<html> | |
<script data-main="" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.8/require.min.js"></script> | |
<script type="text/javascript"> | |
//function that gets called on body onload | |
define('loadPage', ['hideAllDivs'], function () | |
{ | |
return function() | |
{ | |
console.log("here"); | |
hideAllDivs(); | |
}; | |
}); | |
//hide all divs | |
define('hideAllDivs', [], function() | |
{ | |
return function hideAllDivs() | |
{ | |
console.log("hi"); | |
}; | |
}); | |
require(['libraries/jquery-1.10.2.min', 'loadPage'], function($, loadPage) { | |
$(function() { | |
loadPage(); | |
console.log("hello"); | |
}); | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment