Skip to content

Instantly share code, notes, and snippets.

@aj0strow
Created July 17, 2014 04:11
Show Gist options
  • Save aj0strow/97f6ebb10e116713d825 to your computer and use it in GitHub Desktop.
Save aj0strow/97f6ebb10e116713d825 to your computer and use it in GitHub Desktop.
RequireJS Hello World
{
"private": true,
"name": "helloworld",
"version": "0.0.0",
"dependencies": {
"requirejs": "~2.1.9"
}
}
define([], function() {
return "Hello World!";
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<body>
<script data-main="require-main.js" src="bower_components/requirejs/require.js"></script>
</body>
</html>
require(
[ 'helloworld' ],
function(helloworld) {
document.write(helloworld);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment