Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- ....
- <script type="text/javascript" src="lib/requirejs/require.js" data-main="src/requireConfigTest"></script>
- ....
- </html>
- /*globals require*/
- require.config({
- shim: {
- },
- paths: {
- famous: 'lib/famous',
- requirejs: 'lib/requirejs/require',
- almond: 'lib/almond/almond',
- 'famous-polyfills': 'lib/famous-polyfills/index'
- }
- });
- // this is the injection point where the dynamic code starts
- define(function (require,exports,module) {
- var Engine = require("famous/core/Engine");
- var Surface = require("famous/core/Surface");
- var mainContext = Engine.createContext();
- var surface = new Surface({
- size: [100, 100],
- content: "Hello World",
- classes: ["red-bg"],
- properties: {
- textAlign: "center",
- lineHeight: "20px"
- }
- });
- alert('hi');
- mainContext.add(surface);
- });
- //this is the end of the dynamic code
- <html>
- ....
- <script type="text/javascript" src="lib/requirejs/require.js"</script>
- <script type="text/javascript">
- /*globals require*/
- require.config({
- shim: {
- },
- paths: {
- famous: 'lib/famous',
- requirejs: 'lib/requirejs/require',
- almond: 'lib/almond/almond',
- 'famous-polyfills': 'lib/famous-polyfills/index'
- }
- });
- // this is the injection point where the dynamic code starts
- define(function (require,exports,module) {
- var Engine = require("famous/core/Engine");
- var Surface = require("famous/core/Surface");
- var mainContext = Engine.createContext();
- var surface = new Surface({
- size: [100, 100],
- content: "Hello World",
- classes: ["red-bg"],
- properties: {
- textAlign: "center",
- lineHeight: "20px"
- }
- });
- alert('hi');
- mainContext.add(surface);
- });
- //this is the end of the dynamic code
- </script>
- require(["famous/core/Engine", "famous/core/Surface"], function (Engine, Surface) {
- var mainContext = Engine.createContext();
- // Etc...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement