TopicObserver.com

Trond Pettersen on Web Development and Topic Maps

Open for Web Development Opportunities in the US.

Tag: javascript

Readable Code: In the Eye of the Beholder?

In his most recent blog posting – In the Eye of the Beholder (ah, reminds me of EoB II), JavaScripter James Padolsey (if you do some JavaScripting / jQuery, follow his blog) argues that the readability of anything is entirely dependent on who’s doing the reading. He also states that readability depends on how proficient the reader is in the given programming language.

I tend to disagree. Readability and understanding are two separate concerns. Readability is about aesthetics. Understanding is about knowledge. Code can be understood without being classified as “readable”.
Read the full article »

Event Delegation with YUI 3.0

Personally I’ve never used the YUI library (yet), but the new event delegation functionality of YUI 3.0 has a very nice look to it:

// Defining simple listeners on each element:
Y.on(“click”, handleClick,
“#container ul li a.profile”);

// Defining listener on a container using the delegate() method:
Y.delegate(‘click’, handleClick,
‘#container’, ‘ul li a.profile’);

[...]

Event delegation in YUI 3 moves the overhead of walking the DOM tree from the loading process to the point of user interaction, and decreases complexity by removing the need to match target elements within the callback. Instead, delegate() tests the event target (e.target) against the selector (‘ul li a.profile’) after the event is fired but before the callback is executed…

More at the YUI Blog.

Simple Web 2.0 Photo Album with jQuery

Yesterday a colleague of mine asked me about what would be the requirements of HTML used for an image gallery using modal windows. As I’ve previously done this myself, I thought I might as well share some code in this blog.
Read the full article »

Easy JavaScripting with jQuery (jQuery Basics)

During the last year I’ve tried using jQuery as much as possible when it comes to adding JavaScript functionality to web interfaces.

For those who still don’t know, jQuery is a cross browser open source JavaScript library which makes it extremely easy to manipulate HTML, perform Ajax requests, apply visual or interactive effects to your site, etc. If you know how to write CSS, you should be able to use jQuery. And if you work with web applications / -programming, you ought to know how to use jQuery or similar frameworks.

The dual licensing model of jQuery (GPL/MIT) makes it a perfect tool for both open source as well as commercial projects and products.
Read the full article »

alert(“crap”);

If only JavaScript developers would stop using alert() for debugging – at least while in production. Searching for flight tickets on www.berg-hansen.no gave me the following:

The page at http://www.solfaktor.com/ says:
TXL not found.

Now, there’s something every user needs to know.

Berg-hansen.no + useless JavaScript alert.

See also: Web 2.0 Usability.

  • RSS @twitter

  • Tags

  • Recent Comments

  • Topics

  • Topic Map Feeds