backbone.js & underscore.js CDN recommendation?

http://www.cdnjs.com hosts a lot of less popular JavaScript frameworks, including: backbone.js: //cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js (HTTP | HTTPS) underscore.js: //cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js (HTTP | HTTPS) For convenience, here are the script tags: Backbone.js <script type=”text/javascript” src=”https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js”></script> Underscore.js <script src=”https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js”></script>

What is context in _.each(list, iterator, [context])?

The context parameter just sets the value of this in the iterator function. var someOtherArray = [“name”,”patrick”,”d”,”w”]; _.each([1, 2, 3], function(num) { // In here, “this” refers to the same Array as “someOtherArray” alert( this[num] ); // num is the value from the array being iterated // so this[num] gets the item at the “num” … Read more

Loading Backbone and Underscore using RequireJS

RequireJS 2.X now organically addresses non-AMD modules such as Backbone & Underscore much better, using the new shim configuration. The shim configuration is simple to use: (1) one states the dependencies (deps), if any, (which may be from the paths configuration, or may be valid paths themselves). (2) (optionally) specify the global variable name from … Read more

how to break the _.each function in underscore.js

You can’t break from the each method—it emulates the native forEach method’s behavior, and the native forEach doesn’t provide to escape the loop (other than throwing an exception). However, all hope is not lost! You can use the Array.every method. đŸ™‚ From that link: every executes the provided callback function once for each element present … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)