JavaScript
Wednesday, August 13th, 2008
Category: JavaScript
, Ruby
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: PLAIN TEXT RUBY: class MyClass @@my_var = 500 def initialize(arg) @arg = arg Read the rest...
Tuesday, August 12th, 2008
Category: iPhone
, JavaScript
, Mobile
, Performance
PLAIN TEXT HTML: <script type="text/javascript"> function recurse(n) { if (n> 0) { return recurse(n - 1); } return 0; } try { // recurse(43687); // Highest that works for me in WebKit Read the rest...
Monday, August 11th, 2008
Category: JavaScript
, Testing
Johannes Link is an Agile fellow who wasn't 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT JAVASCRIPT: testDoubleSpeaker: function() { with(this) { var actualMsg = null; var mockSay = function(msg) { actualMsg = msg; Read the rest...
Thursday, August 7th, 2008
Category: JavaScript
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...
Wednesday, August 6th, 2008
Category: JavaScript
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...
Category: HTML
, JavaScript
, Tip
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: PLAIN TEXT JAVASCRIPT: // put it in var doc = iframe.document; if (iframe.contentDocument) doc = iframe.contentDocument; Read the rest...
Monday, August 4th, 2008
Category: Component
, JavaScript
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: PLAIN TEXT JAVASCRIPT: var tp = new TimePicker('time2_picker', 'time2', 'time2_toggler', {format24:true}); Or a more complex version that Read the rest...
Wednesday, July 30th, 2008
Category: JavaScript
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...
Category: JavaScript
, Prototype
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: PLAIN TEXT JAVASCRIPT: Event.onJSReady(function () { dependent_on_external_js(); }); Read the rest...
Tuesday, July 29th, 2008
Category: Book Reviews
, Books
, JavaScript
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...
Monday, July 28th, 2008
Category: Browsers
, JavaScript
, Performance
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...
Thursday, July 24th, 2008
Category: JavaScript
, Performance
, Yahoo!
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: PLAIN TEXT JAVASCRIPT: var myHandler = { onSuccess: function(){ alert(':))'); }, Read the rest...
Wednesday, July 23rd, 2008
Category: Ajax
, Dojo
, JavaScript
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...
Category: GWT
, JavaScript
Bruce Johnson has written an expansive post on understanding the GWT JavaScript Native Interface (JSNI). It starts out with the piece that some people know about, namely inlining native JavaScript such as this: PLAIN TEXT JAVA: // Java method declaration... native String flipName(String name) /*-{ // ...implemented with JavaScript var re = Read the rest...
Monday, July 21st, 2008
Category: JavaScript
, Performance
John Resig continues his streak of compelling blog entries with "DOM DocumentFragments" where he shows that: A method that is largely ignored in modern web development can provide some serious (2-3x) performance improvements to your DOM manipulation. The technique shown is compatible across a large swath of modern browsers, including our friend IE6. Here's an Read the rest...
Monday, July 14th, 2008
Category: Gears
, JavaScript
, Podcasts
, Rails
, Ruby
With my Google hat on, I got to interview Michael Marcus and Rui Ma, two recent graduates from a masters program at NYU. They joined me to discuss Gears on Rails, their open source framework that makes it easier than ever to take a Rails code-base offline. They take the approach of giving you a Read the rest...