javascript

FacebookTwitter
js-testing

Organize Your Code with RequireJS

Writing web applications using JavaScript, HTML, and CSS can become overwhelming quickly. Between managing UI, data, interactions, and network requests, application code can become a real mess, and this isn’t helped by the way the browser loads JavaScript code. In most other programming environments, there is some way to split your code into modules or scripts, and specifically require one module from another. In JavaScript, we can split our code into multiple files, but there is no way to declare in one script that you are depending on another. http://blog.teamtreehouse.com/organize-your-code-with-requirejs

Retrieve Unique Values from an Array with JavaScript

http://net.tutsplus.com/tutorials/javascript-ajax/javascript-from-null-utility-functions-and-debugging/ The Full Series JavaScript University continues as we develop our first utility function that will allow us to filter and retrieve only the unique values from an array. Along the way, I’ll also teach you how to use the excellent Firebug to debug your code. Utility Functions and Debugging

Sandbox Your Cross Domain JSONP To Improve Mashup Security | BeeBole

http://beebole.com/blog/general/sandbox-your-cross-domain-jsonp-to-improve-mashup-security/ JSONP is a very neat way to get JSON data from other domains. The concept was brought by Bob Ipolito in 2005 , and today it is widely available from API providers. The big issue about JSONP is security. If you inject an unknown script in your page, you give to the script author a potential way to read the entire page content, scripts, cookies and data. So, if you think, like us, the cool way to build web apps today is about building services and aggregating them with external APIs in Mashups, you have a problem.
When asked what he might do differently if he had to rewrite Java from scratch, James Gosling suggested that he might do away with class inheritance and write a delegation only language . Using inheritance as a vehicle for code reuse is a bit like ordering a happy meal because you wanted the plastic toy. Sure a circle is a shape and a dog is a mammal – but once we get past those textbook examples most of our hierarchies get arbitrary and tenuous – built for manipulating behaviour even as we pretend we are representing reality. Successive descendants are saddled with an ever increasing number of unexpected or irrelevant behaviours for the sake of re-using a few. Delegation is a technique that promotes code reuse by allowing runtime function invocation in the context of a specific instance – regardless of the hierarchical lineage of instance and function. http://javascriptweblog.wordpress.com/2010/12/22/delegation-vs-inheritance-in-javascript/

Delegation vs Inheritance in JavaScript | JavaScript, JavaScript

Test-Driven JavaScript Development in Practice

http://net.tutsplus.com/tutorials/javascript-ajax/test-driven-javascript-development-in-practice/ TDD is an iterative development process where each iteration starts by writing a test which forms a part of the specification we are implementing. The short iterations allow for more instant feedback on the code we are writing, and bad design decisions are easier to catch. By writing the tests prior to any production code, good unit test coverage comes with the territory, but that is merely a welcome side-effect. Republished Tutorial Every few weeks, we revisit some of our reader's favorite posts from throughout the history of the site.
jquery