Created
November 6, 2011 05:01
-
-
Save zonak/1342498 to your computer and use it in GitHub Desktop.
RequireJS combo
This file contains 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
# /index.html | |
<!doctype html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="author" content="zonak"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<link rel="stylesheet" href="css/style.css"> | |
<script src="/js/libs/modernizr.js"></script> | |
</head> | |
<body> | |
<header> | |
</header> | |
<div role="main"> | |
</div> | |
<footer> | |
</footer> | |
<script data-main="js/main" src="/js/libs/require.js"></script> | |
<!-- end scripts --> | |
<!--[if lt IE 7 ]> | |
<script defer src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script> | |
<script defer>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script> | |
<![endif]--> | |
</body> | |
</html> | |
# /js/main.js | |
(function() { | |
require.config({ | |
baseUrl: "/js/", | |
paths: { | |
'jquery': 'libs/jquery', | |
'underscore': 'libs/underscore', | |
'backbone': 'libs/backbone', | |
'order': 'rjs_plugins/order' | |
} | |
}); | |
require(['jquery', 'underscore', 'backbone', 'utils'], function($, _, Backbone, Utils) { | |
console.log('jQuery Version: ' + $.fn.jquery); | |
console.log('Underscore Version: ' + _.VERSION); | |
console.log('Backbone Version: ' + Backbone.VERSION); | |
}); | |
}).call(this); | |
# /js/utils.js | |
(function() { | |
define(["jquery"], function($) { | |
(function(b) { | |
var c; | |
return c = function() { | |
var a, _i, _len, _ref, _results; | |
_ref = "assert,clear,count,debug,dir,dirxml,error,exception,firebug,group,groupCollapsed,groupEnd,info,log,memoryProfile,memoryProfileEnd,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn".split(","); | |
_results = []; | |
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | |
a = _ref[_i]; | |
_results.push(b[a] = b[a] || c); | |
} | |
return _results; | |
}; | |
})((function() { | |
try { | |
console.log(); | |
return window.console; | |
} catch (err) { | |
return window.console = {}; | |
} | |
})()); | |
}); | |
}).call(this); |
Thank you so much for looking into it.
I tried your example and worked without the issue for me too.
I also tried loading only utils the same way you did - but the issue was still there. Having your example go through eliminates problems with FF so there is definitely something.
I'll keep looking and if I find something I will let you know.
Thanks again,
<z/>
…On Sunday, November 6, 2011 at 2:29 AM, James Burke wrote:
I used this to make [a running example](http://www.tagneto.org/zonak.html), but seems to work for me, had to modify some things, only load utils, but my concern was that there was a mismatch between baseUrl used to load main.js and the one specified in main.js, but it all seems to work out.
So I'm not sure what the problem could be.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1342498
Well I think I found the offending code.
Once I removed the code from utils.js:
https://gist.github.com/1342539
the issue stopped happening. Tried adding something else in that module, everything worked fine after removing the mentioned section.
Will try to investigate further what exactly might be causing this.
Well I don't know if it helps in any way but the cause is the call to:
console.log()
in the "try" block.
Still don't know why it is not happening on your example.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used this to make a running example, but seems to work for me, had to modify some things, only load utils, but my concern was that there was a mismatch between baseUrl used to load main.js and the one specified in main.js, but it all seems to work out.
So I'm not sure what the problem could be.