Skip to content

Instantly share code, notes, and snippets.

@christopherliu
Forked from anonymous/Index.html
Last active December 22, 2015 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christopherliu/6454758 to your computer and use it in GitHub Desktop.
Save christopherliu/6454758 to your computer and use it in GitHub Desktop.
<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