Recent Entries:

Favorite Links

Respect for JavaScript

Tuesday, April 7th, 2009

Surfing around I found this cool video of Doug Crockford, the man behind JSLint and JSON. He surely is a funny guy

OnTheFly

Thursday, March 19th, 2009

I Just published on github a tool to concatenate JavaScript and CSS files on the fly to speed up the development process when using large code base. Check the project page

Hemnet & Eniro launched!

Thursday, October 23rd, 2008

After working last year at Eniro maps to introduce the “utsikt” images (images taken from an airplane at a 45° angle), we have today successfully launched the integration of Eniro maps on Hemnet, Sweden largest site for real-estate.
During the project I acted as a javascript programmer and as a scrum master together with Torsten Ek [...]

Encoding of included JSON files

Tuesday, October 7th, 2008

Lately I had a problem with a page which was including two JSON scripts, one encoded in UTF-8 and the other encoded in ISO-8859-1.
In some circumstances (and in some browsers) the strings where not showed correctly.
Hunting down the problem required a good dose of my favourite tool wget -S where the -S option causes the [...]

onresize event and prototype

Tuesday, September 2nd, 2008

If you need a compact way to use prototype and listen to on onresize event in a cross-browser manner, this is the way to go:

Event.observe(document.onresize ? document : window, “resize”, function() {//dostuff});

As you can see, the event to listen is resize but depending on the browser, it may be fired on either the window or [...]

Object.extend, an example of inheritance

Tuesday, September 2nd, 2008

Updated: my previous attempt to simulate inheritance in javascript using Prototype.extend did not work as I expected so I removed the example I had written.

Inheritance can be defined in several ways. The definition of inheritance I will use in the following example is: A child class inherits from a parent class if all methods of [...]

onmouseover / onmouseout and nested divs

Friday, August 29th, 2008

I had never noticed a behavior which left me astonished
If you have two nested divs and are listening for the onmousover event on the parent div, you will get a onmouseout event when entering the nested div!
parent div
Nested div

As I see it, since the mouse has not left the area covered by the red [...]