Christian Heilmann

You are currently browsing the archives for the General category.

Archive for the ‘General’ Category

Meet me at the Newsagent\’s

Thursday, August 17th, 2006

The August issue of Practial Web Design is out and features an article of mine about creating plugins for Yahoo Messenger.

Practical webdesign August 2006
My article on how to create Messenger Plugins

\”More content\” links, cloneNode(), YUI and Safari/MSIE issues

Monday, August 14th, 2006

cloned sheep When I was creating a proof of concept the other day about how to create ‘more content’ links with JavaScript and the YUI I stumbled across an interesting problem with the YUI Event utility.

The Event Utility is IMHO the cat’s pajamas as it solves a lot of issues the tried and true addEvent didn’t: It retains the scope allowing you to use “this” in the listener method, makes preventDefault work in Safari and also allows you to send another custom object to the listener method, all of which make is a lot easier to write unobtrusive JavaScript without the memory leaks.

Now, the interesting problem I stumbled upon is that if you do the following

  • create a new link
  • add attributes, content and all that jazz
  • apply an event handler
  • clone the link
  • apply another handler to the second link

you’re in for trouble. Safari applies both handlers to the first link and none to the second, and MSIE applies both the first and the second handler (in reverse order) to the second link! Here’s the test case using YUI. The MSIE problem of the double handler on the second link also happens when you use the tradional addEvent.

I talked to the YUI folks and Adam told me that applying unique IDs to the links solves the issue in Safari, however it doesn’t make a difference in MSIE.

The lesson to take away:

If you clone elements, make sure to clone them before you apply the handlers, and remove all handlers just to be on the safe side

A shame, as I really like the idea of cloning elements. The other option of course is a constructor method for repeated elements.

[tags]more links, webdevtrick[/tags]

Safari for Windows – well almost

Tuesday, August 8th, 2006

You can now get a WebKit based browser for PC, which allegedly works and renders like Safari.

It is called Swift and can be downloaded at http://www.getwebkit.org/

In order to keep the original PC/Windows vibe going, the install will crash unless you apply a patch beforehand.

Testing ahoy!

Chris

Win free ebooks and copies of my books!

Monday, August 7th, 2006

I just published a competition on The web site of Beginning JavaScript with DOM Scripting and Ajax with prices like free ebook vouchers, copies of said book or Web Accessibility: Web Standards and Regulatory Compliance . All you need to show is either a little creativity or lack of fear of public embarassment.

On to the competition

Workfriendly surfing

Wednesday, August 2nd, 2006

Workfriendly Wait-till-i.com I just stumbled upon workfriendly, a web service that shows a web site inside a frame that looks like it is Microsoft Office Word 2003. The clue is that instead of just showing the page in the frame, the service also turns off imagery and layout and makes the web site appear as if it was a Word document. Perfect for those offices where the boss frowns upon web surfing.