Archive for the 'code' Category

JavaScript Tricks And Good Programming Style

August 9th, 2006 by Alexander Kirk | Comments 42 Comments »

Note that this is an updated version. Original version can be found here. Thanks to the commenters I have updated this post with some better tricks. In a loose series I'd like to point out a few of them. As I am currently mostly programming in JavaScript, I will write most of my samples in […]

JavaScript Tricks And Good Programming Style – Original Version

August 8th, 2006 by Alexander Kirk | Comments Comments Off

Note that there is an updated version I have been programming for about 10 years now, and I am always longing for improving my code. Throughout time I added a few habbits that I consider to be good practices and increase the quality of my code. In a loose series I'd like to point out […]

Firefox 1.5, XmlHttpRequest, req.responseXML and document.domain

July 27th, 2006 by Alexander Kirk | Comments 3 Comments »

Recently I have been working on a web application, extending it with an iframe on another subdomain. When you set up communication with an iframe on another subdomain, it works by setting document.domain in both pages. Pretty nice and straight forward. But it can mess up the rest of your page. As soon as you […]

Misuse of the Array Object in JavaScript

May 18th, 2006 by Alexander Kirk | Comments 4 Comments »

There is a very good post about Associative Arrays considered harmful by Andrew Dupont. The title is a bit misleading but correct. When coming accross a piece of JavaScript like this foo["test"] = 1; there is nothing wrong about it. It's the basic usage scheme of assoziative arrays. Or should i rather say objects? While […]

Welcome naked!

April 5th, 2006 by Alexander Kirk | Comments Comments Off

Today is CSS Naked Day. Take this chance to visit my site in person (= with your browser). Looking quite okay naked, too ;) css naked day, css

A better understanding of JavaScript

March 2nd, 2006 by Alexander Kirk | Comments 3 Comments »

I've been working with JavaScript for years. It was my replacement for a server side language when I couldn't afford to buy web space in the mid-90's. Still, as the language becomes popular again, I recognized that I did understand the basics but there was much more to the language. digg it, add to delicious […]

10 Realistic Steps to a Faster Web Site

February 2nd, 2006 by Alexander Kirk | Comments 56 Comments »

I complained before about bad guides to improve the performance of your website. digg it, add to delicious I'd like to give you a more realistic guide on how to achieve the goal. I have written my master thesis in computer sciences on this topic and will refer to it throughout the guide. 1. Determine […]

Speed up your page, but how?

January 3rd, 2006 by Alexander Kirk | Comments 2 Comments »

Today I ran accross the blog entry by Marcelo Calbucci, called "Web Developers: Speed up your pages!". It's a typical example of good idea, bad execution. Most of the points he mentions are really bad practice. He suggests reducing traffic (and therefore loading time) by removing whitespace from the source code, to write all code […]

Using a Feedback Form for Spam

November 11th, 2005 by Alexander Kirk | Comments 3 Comments »

Have you ever received weird spam via the feedback form of your site? Something with your own address as sender or with some Mime stuff in the body? Your form is likely to be misused for spamming. How does it work? For PHP, for example, there is the mail function that can be used to […]

Eclipse Everywhere. Buah.

October 19th, 2005 by Alexander Kirk | Comments 11 Comments »

It's been a little quiet lately. This is because I am working on a cute little project that I will be able to present soon. More when the time is ready. There has been rumor lately that Zend (developer of PHP) will release a PHP Framework. This is nothing new, there has been a IDE […]

Caching of Downloaded Code: Testing Results

October 11th, 2005 by Alexander Kirk | Comments 7 Comments »

Today I did some experimenting with the caching of downloaded code (or On-Demand Javascript, whatever you want to call it). I've set up a small testing suite that currently tests 3 different ways of downloading code: script-tag insertion via DOM, XmlHttpRequest as a GET and XHR as a POST. These are my results for now: […]

Better code downloading with AJAX

October 10th, 2005 by Alexander Kirk | Comments 3 Comments »

I've been playing with Code downloading (or Javascript on Demand) a little more. Michael Mahemoff pointed me at his great Ajaxpatterns in which he suggests a different solution: if (self.uploadMessages) { // Already exists return; } var head = document.getElementsByTagName("head")[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "upload.js"; head.appendChild(script); Via DOM manipulation a […]