JavaScript


Friday, February 27th, 2009

Ghosts in the machine – avoid using window.sun in Firefox as it starts the Java engine!

Category: Java, JavaScript, Mozilla

Sometimes you find leftovers of old technology in browsers that blow your mind. One of these “ghost in the machine” problems exists in Firefox: if you use window.sun or function sun() in JavaScript you effectively start the Java VM. There are a few “magic” properties on Mozilla’s DOMWindow interface for supporting LiveConnect that will initialize Read the rest…

Posted by Chris Heilmann at 2:18 am
5 Comments

+++--
3.8 rating from 17 votes

Thursday, February 26th, 2009

Aurora: Class types and invariants in JavaScript

Category: Examples, JavaScript

Ryan Morr has created a really fun experiment that shows the versatility of JavaScript. He just announced Aurora, fun times with class types and invariants in JavaScript. He introduces the project: The goal of the project is to provide a means of defining instance variables bound to a specific data type as you would find Read the rest…

Posted by Dion Almaer at 2:21 pm
Comment here

+++--
3.7 rating from 37 votes

Namespace.js: take a wild guess….

Category: JavaScript, Library

Let’s lead with code: < View plain text > javascript Namespace(‘foo.bar’); foo.bar.myFunction = function() {};   Namespace(‘com.example’, {    MyClass: function() { return {}; } }); var obj = new com.example.MyClass();   Namespace.use(‘com.example.MyClass’); var obj2 = new MyClass();   // include com/example/RemoteClass.js Namespace.include(‘com.example.RemoteClass’); var obj3 = new com.example.RemoteClass();   Namespace.registerNativeExtensions(); ‘com.foo.bar’.namespace(); Reading the code above Read the rest…

Posted by Dion Almaer at 2:10 pm
Comment here

+++--
3.2 rating from 29 votes

Wednesday, February 25th, 2009

Ext JS and Adobe AIR

Category: Adobe, Bespin, JavaScript, Sencha

As we’ve been exploring ways to take Bespin to the desktop, we’ve looked closely at some of the single-site browser technologies and their individual APIs to work out which platform we favor. As we went through this exercise, Adobe AIR really impressed us with the richness of its JavaScript APIs which wrap native APIs (as Read the rest…

Posted by Ben Galbraith at 5:00 am
5 Comments

++++-
4.4 rating from 57 votes

Tuesday, February 24th, 2009

Creating another library called Prototype?

Category: JavaScript, Library

Ben Gerrissen has created a library to handle prototype-based inheritance and the module pattern. The problem is that Ben named it Prototype! Are you kidding me Ben? :) As a reaction to the Javascript Inheritance Performance post, I found myself thinking; “Why is everyone trying to superimpose Classical OO on Prototypical OO” and “There should Read the rest…

Posted by Dion Almaer at 5:27 am
25 Comments

+++--
3 rating from 19 votes

Friday, February 20th, 2009

Comparison of JavaScript Inheritance Mechanisms; Proposal

Category: JavaScript

Andrea Giammarchi took the time to compare the JavaScript inheritance mechanisms in base2, Dojo, jsClass, MooTools, Prototype, and YUI and illustrates the same scenario with all of those frameworks. Handy indeed! He concludes with a proposal: WebReflection Proposal After an analysis like this one, how could I skip my “all the best from others without Read the rest…

Posted by Ben Galbraith at 8:00 am
11 Comments

++---
2.9 rating from 41 votes

Sprockets: Build time JavaScript dependancy management

Category: JavaScript, Ruby, Utility

Sprockets is a build time Ruby tool that reads in your JavaScript files, preprocesses and concatenates: It takes any number of source files and preprocesses them line-by-line in order to build a single concatenation. Specially formatted lines act as directives to the Sprockets preprocessor, telling it to require the contents of another file or library Read the rest…

Posted by Dion Almaer at 12:01 am
3 Comments

+++--
3.4 rating from 30 votes

Thursday, February 19th, 2009

Nextpoint releases open source project Growl4Rails

Category: Component, JavaScript, Prototype, Rails

The team at Nextpoint has released the open source project Growl4Rails, a component providing Growl-like functionality in Rails web applications. Nextpoint’s e-discovery product deals with many very large documents. Indexing, imaging and PDF-ing of those documents can take a bit of time, which requires us to execute these tasks asynchronously. Background processing demands a solid Read the rest…

Posted by Dion Almaer at 12:01 am
Comment here

+++--
3.7 rating from 29 votes

Wednesday, February 18th, 2009

JavaScriptMVC 1.5 Released

Category: JavaScript

Justin Meyer emailed me to let me know that JavaScriptMVC, the framework that provides a Model-View-Controller (MVC) pattern for JavaScript development, has been updated and version 1.5 is offically available for download. New features include: Env.js/Shrinksafe based compression: A custom env to simulate the browser. As the browser encounters script tags, it adds them to Read the rest…

Posted by Rey Bango at 3:31 pm
Comment here

+++--
3.3 rating from 34 votes

JavaScript Inheritance Performance

Category: JavaScript, Performance

Robert Kieffer has run some benchmarks on the performance of JavaScript inheritance using different inheritance techniques: One area of the Prototype JavaScript library that I have a bit of a love-hate relationship with is its support for mimicing OO inheritance.   The ability to call $super from within a function to refer to a superclass’ Read the rest…

Posted by Dion Almaer at 6:34 am
17 Comments

++++-
4.1 rating from 14 votes

Tuesday, February 17th, 2009

Xopus Application Framework: Objective-J Done Different

Category: Framework, JavaScript

The good folks at Xopus (the really cool browser-based XML editor) have been working largely in silence on a new version of their application. They’ve recently posted a presentation that talks about the framework behind this new version of Xopus. In the linked PDF, the framework is revealed to be an “object-oriented ‘extended subset’ of Read the rest…

Posted by Ben Galbraith at 11:00 am
7 Comments

++---
2.8 rating from 24 votes

Monday, February 16th, 2009

Designing a JavaScript client for a REST API

Category: Articles, JavaScript

This is a guest post by Jared Jacobs of the KaChing, an exciting new way to do your own hedge fund, the Web 2.0 way (a.k.a. don’t give it to Madoff!). I was very happy when he said he would be willing to do a post on REST APIs, and what makes a good design. Read the rest…

Posted by Dion Almaer at 9:01 am
8 Comments

+++--
3.5 rating from 28 votes

xLazyLoader: Lazy loader callback framework

Category: JavaScript, jQuery, Library

Oleg Slobodskoi, guru behind jimdo.com, has open sourced xLazyLoader a jQuery plugin that lets you asynchronously load resources such as JavaScript, CSS, and images. Quite useful if you want to head of and load some CSS to do something custom and you need the callback. Example < View plain text > javascript $.xLazyLoader({     Read the rest…

Posted by Dion Almaer at 6:55 am
Comment here

+++--
3.6 rating from 50 votes

Thursday, February 12th, 2009

Bespin: A new Mozilla Labs experimental extensible code editor using Canvas

Category: Canvas, JavaScript, Mozilla, Showcase, Utility

Ben and I are excited to be releasing the first concept out of the Mozilla Developer Lab. As you know, we are big believers in the Open Web. Chris Wilson mentioned that many people are still building Web applications on top of browser technology from yester year. What if we built on more leading edge Read the rest…

Posted by Dion Almaer at 9:50 pm
47 Comments

++++-
4.6 rating from 83 votes

Monday, February 9th, 2009

Building an isNative method

Category: JavaScript

If you want to test if a method is “native” in that the host provided the methods, versus a third party method (including one that has overridden a native function) it can be tricky. Kangax posted on the issue where he took a note Diego Perini on an impl: < View plain text > javascript Read the rest…

Posted by Dion Almaer at 3:49 am
14 Comments

++---
2.3 rating from 22 votes

Friday, February 6th, 2009

True JavaScript Hash Table

Category: JavaScript

While it’s great that JavaScript has a built-in hash-like mechanism, but it is limited to string keys. Tim Down recently filled us in on his project to create a more flexible hash table: I occasionally want a proper hash table in JavaScript, by which I mean something that can map an arbitrary key object with Read the rest…

Posted by Ben Galbraith at 9:00 am
5 Comments

+++--
3.1 rating from 43 votes