6 Feb, 2008
Was: self-currying JavaScript functions
I read this nice post on self-currying JavaScript functions, and even though the code to me is not optimal (dispite the low line count), it is improperly named, and it depends on the Prototype JavaScript library (which I really don’t like), it is a very nice script and a very nice idea. The trick in this script is using Function.prototype.length. I didn’t know that this property existed, but after digging a bit I’ve realized, that it has been in ECMAScript at least since 3rd edition (which is the latest edition published in 1999), in JavaScript since v1.1, but only made it into ActionScript by ActionScript 3 (which I haven’t study in as much detail as I have with ActionScript 1 and 2 in relation to my book on basic programming in these versions).
In this post I discuss this property and functionality a bit further, and I implement this function for creating self-”partially applying” functions using both no framework, the MochiKit framework and the Prototype framework.
Read the rest of this entry »
27 Sep, 2007
A recent post on the MochiKit mailing list inspired me to have a little more fun with MochiKit, which I use a lot professionally and privately. The task was to see how simply a filtering for tables could be done using MochiKit.
The first task was to identify all the problems of the original script. Then comes setting up the basics, and finally implementing the necessary functionality. And as always MochiKit supplies so many convenient functions, that only the fun part is left. Furthermore this article suggest some simple extensions to the concept of filtering.
Read the rest of this entry »
4 Sep, 2007
Bibliotekr (a badly hidden pun on Flickr) is an idea crafted by a group of persons trying to create a book-sharing site “competing” with the Danish libraries. And one of the organizers had thrown together a small Hackathon, which I just had to attend.
Read the rest of this entry »
14 Aug, 2007
Today we launched a new website for one of the major Danish mortgage provider, Totalkredit. They are known by all Danes due to their tv-ads (produced by TBWA\Copenhagen), that everyone either hates or loves. This is a very big client, and thus they require a very big website. But as they are for the people and tries to communicate directly with the common man, the website need not be corporate, but must be rich with content, easy to use and with many features that will create returning visitors.
Well, all this I did not have much to do with, that concerns the concept department. But concretising, technically verifying and realizing this concept is very much my job. The project has taken many months but it is now finally complete. Or well, such is never complete, but the first version has been launched at least. And this site is (technically) amazing if I should describe it. The amount of JavaScript used is huge and much of it uses MochiKit heavily. The JavaScript is used to enliven the page in a very interesting way.
The whole page works without JavaScript in the classical fashion (clicking links, reloading the whole page with the new page), but with JavaScript enabled, all links are caught and handle via Ajax instead. This technique was introduced to me by Jeremy Keith and his somewhat cute term Hijax. In order to do this, but not combine markup with content, large portions of the HTML (very large in fact) are built in JavaScript. For this need MochiKit.DOM is really handy.
Other features of the site, that makes this a very satisfying job to have completed:
- It is of course search engine optimized (Hijax preserves this)
- It uses a very concise, readable markup and works as mentioned without JavaScript (the properties of Progressive Enhancement)
- The URL is modified on every major page change using fragments in order to allow deep-linking and bookmarking (this is partly self-developed, partly borrowed from SWFAddress)
- And given the above, that “back” and “forward” buttons of the browser works (unlike many other full-Ajax websites)
- The site includes Google Maps (you can’t go wrong with that!)
- The site is tested and optimized for Internet Explorer 6 and 7 as well as Firefox 2 (and friends).
Enough talking, here is the site: http://www.totalkredit.dk – “unfortunately” most of the site is in Danish except for a small investor-part.
30 May, 2007
Google Maps Street View is pretty amazing. The detail, the 360 view, the small increments between images. Just see these poor guys driving down Park Drive N. Google is quite amazing. This new street view has mapped 5 cities in the US.
Read the rest of this entry »
29 May, 2007
James Ward has created a nice little application for benchmarking Rich Internet Applications. And Flex sure is the winner, when it comes to separating content and layout. Serverside-generated table loading via AJAX is fast too, but that is not a very nice solution to many’s opinion. Thus, Flex clearly wins overall, and AJAX JSON comes in second place, if you cannot go the flash way.
11 May, 2007
I’ve discovered GreaseMonkey. Yes, I am a bit late, but once I finally installed it, I sure love it. Though the script, that I needed, only existed in a very simple version.
I have thus taken the initial version of the Google Calendar TODO list by Matias Pelenur and the modified version by Gimite Ichikawa and created a brand new version that I submitted to UserScripts.org.
First thing this new version does is, that it uses the eventStatus-field for setting whether the todo has been done or not. And then there is a flush button to flush (remove) todones. And finally the todos and todones are sorted using the status and title. This will be a work in progress and will be developed further upon.
Read the rest of this entry »
27 Mar, 2007
I’m currently working on an AJAX-driven site also using Google Maps’ externally accessible API. But I have as several others been frustrated about the fact, that the GMarkerManager-class does not contain a clearMarkers method. So I combined the open-sourced source with the latest closed-source release, and mashed stuff up like this:
Read the rest of this entry »