JavaScript

John Resig is working on the Secrets of the JavaScript Ninja book, which I am sure will be a success. Manning has been kind enough to give us a sneak peak at some of the chapters: How closures work This content introduces the closure, an important aspect of JavaScript, and describes its use. It goes Read the rest…

I discussed my worries about JavaScript 2 recently. I could only do so as I saw some light at the end of the tunnel. That light came from an ECMA meetup in Oslo where it seems people came together to rally behind the idea that something needs to be done. Brendan Eich posted to a Read the rest…

I am a fan of Ruby, and when I saw Red the framework that allows you to write Ruby and get JavaScript out the other end I was excited. It allows you to write this: < View plain text > ruby class MyClass @@my_var = 500 def initialize(arg) @arg Read the rest…

I created an introductory example discussing custom events as an implementation of the Observer pattern. I posted this on my personal blog first and quickly got a port from my Prototype version to Malte’s jQuery port (and now we have a DOMAssistant and Appcelerator versions). I hope others keep them coming so we can aggregate Read the rest…

In the code-on-demand style, a client component has access to a set of resources, but not the know-how on how to process them. It sends a request to a remote server for the code representing that know-how, receives that code, and executes it locally. The above quote comes from the infamous thesis by Roy Fielding Read the rest…

Michael Mahemof is working a lot with TiddlyWiki and posted on how the project injects HTML into an iframe, and then get them out later. This enables you to use the browser parser to do its thing: < View plain text > javascript // put it in var doc = iframe.document; if (iframe.contentDocument) doc Read the rest…

The NoGray Time Picker is a component that lets you add a time picker that is visual. The clock shows up, and you move the hands to wherever you need to be. All via a simple: < View plain text > javascript var tp = new TimePicker(‘time2_picker’, ‘time2’, ‘time2_toggler’, {format24:true}); Or a more complex version Read the rest…

In my other life as a desktop application developer (which due to a mix of Fluid, AIR, Prism, canvas, SVG, and Flash is threatening to converge on my Ajax life) I’ve long been a fan of data-binding frameworks that make it easy to have a form automatically synchronize with backing data structures, saving you from Read the rest…

In a follow-up to our post a few days ago on parallelizing JavaScript loading and firing an event when loading is done, Stefan Hayden wrote a Prototype extension (based on onDOMReady) that makes it easy for you to execute your code when all JavaScript is loaded: < View plain text > javascript Event.onJSReady(function () { Read the rest…

I heart David Flanagan. I’m making my way through “The Ruby Programming Language” this summer. Its exhaustiveness really satisfies. But a decade ago, my programming Bible was Flanagan’s “JavaScript: The Definitive Guide”. As I transitioned from a career in content to a career in code, “the Rhino book” taught me everything I needed to know Read the rest…

Gregory Reimer, frontend engineer for sun.com, has written a barrage of tests to answer the question What’s the Fastest Way to Code a Loop in JavaScript? specifically for large data sets: I built a loop benchmarking test suite for different ways of coding loops in JavaScript. There are a few of these out there already, Read the rest…

Stoyan Stefanov has a post that discusses the issues with browsers blocking on script tags. He discusses the general problem and how YUI has a helper for it by using onreadystatechange and onload: < View plain text > javascript var myHandler = { onSuccess: function(){ alert(‘:))’); }, Read the rest…

We have written about using window.name as a transport and Kris Zyp has just posted about how Dojo has created a new dojox.io.windowName module. The window.name transport is a new technique for secure cross-domain browser based data transfer, and can be utilized for creating secure mashups with untrusted sources. window.name is implemented in Dojo in Read the rest…