JavaScriptCore, the WebKit JavaScript Implementation Explained
http://wingolog.org/archives/2011/10/28/javascriptcore-the-webkit-js-implementation
Andy Wingo takes a look at the WebKit project’s JavaScript implementation, JavaScriptCore - as used in Safari. He digs deep, explaining how things work at the bytecode level.
(Source: gregbabula)
Monday Nov 7th
5 notesJavaScript Snippet – String.prototype.hashCode()
String.prototype.hashCode = function() {
for(var ret = 0, i = 0, len = this.length; i < len; i++) {
ret = (31 * ret + this.charCodeAt(i)) « 0;
}
return ret;
};
Wednesday Nov 2nd
Event Delegation in jQuery and Performance (live vs bind vs other options)
A really interesting article about event delegation using various jquery techniques and a non-jquery (i.e. real javascript :|) alternative.
http://www.ravelrumba.com/blog/event-delegation-jquery-performance/
A summary of the results…
“Note: the .is() and plain Javascript options assume that the event target is the element with which you want to work. .live(), which uses jQuery’s .closest() method, provides extra functionality by walking up the DOM to match possible ancestors. So on one hand you could call this an apple-and-oranges comparison. On the other, .live() is still a common solution for those only looking to capture the event target, and to that extent I think it’s a fair and worthwhile comparison.
The advantages of event delegation and of .live() over .bind() have been thoroughly discussed elsewhere. And of course there are considerations beyond what’s represented in Firebug’s profiler. So I’m not sure there’s much to say about that.
The document .bind()/.is() still has some of the jQuery overhead with the document query but overall it comes in quite ahead of .bind() and .live().
jQuery 1.4a’s .live() executes in fewer function calls than 1.3.2′s .live() but the timing is no better. In these tests at least it’s actually slightly worse.
Performance-wise, the Javascript option wins by a mile. If you’re not using a library and if you don’t need the event object normalizing that a library offers, you might consider going with the regular Javascript. But chances are you’re already using a library for something, and in that case something like the .bind()/.is() compromise may be the best option.
Of course, we’re talking about very thin margins, margins unlikely to have an observable effect on your site. And your page probably won’t have 500 elements you need to match. But hopefully there’s something in these numbers that might inform other decisions related to event handling and performance.”
Monday’s thought.
Monday Sep 26th
Plupload

The developers of TinyMCE brings you Plupload, a highly usable upload handler for your Content Management Systems or similar. Plupload is currently separated into a Core API and a jQuery upload queue widget this enables you to either use it out of the box or write your own custom implementation.
Monday Sep 5th
cryptico.js
JavaScript library for encrypting text on the client-side.
(Source: decodering, via gregbabula)
Tuesday Aug 30th
5 notes