A notch above a monkey

XMLHttpRequest and status 0

Have you ever encountered a problem with XMLHttpRequest (XHR), where its handler couldn’t read request status or the status was set to 0?

Well, I did, a few days ago.

It took me a while to find the cause of this problem and in my case it was form submission. It’s stupid to use AJAX to submit a form, but nevertheless it’s what I’m doing for dubious reasons that I’ll probably be ashamed of in a few months or years. And it used to work fine, until I changed submit buttons from type=”button” to type=”image” .

First type needs javascript to do anything worthwhile, while second type submits form when pressed, which I somehow missed. So, when I thought I was sending only a normal XHR request, I was actually also submitting my form which lead to described strange behavior.

I have no idea why, since XHR state change handler shouldn’t be triggered by other requests, but it was and it was fixed by simply canceling form submission in image button onclick handler.

If you ever encounter this problem, check your forms and their submit buttons. It’s very likely that solution is hiding there.

@media 2006

@media 2005 was fantastic and it look like @media 2006 will be at least as good. If you’re a web developer and the list of speakers doesn’t get you excited, then you ought to find another vocation.

On a different note this blog is on hiatus until mid-January.

Happy holidays

In a few hours I’ll be going on a trip to Stockholm, so this is probably the last post of this year. It also happens to be the 100th post since it was started six months ago, making it a perfect place to recapitulate this year and this blog.

It has become a custom by now to flood web with such articles at this time of the year, so I’ve decided to limit mine to a much less talked topic, a state of web in Slovenia.

It’s certainly been an interesting year. We’ve experienced a rise of web standards based designs and even got first slovenian AJAX application intended for wide use. Truth be told, I don’t really know when it was launched, since I more or less stumbled upon it, but it seems that until this year, most of my colleagues weren’t aware of it either. Also it’s the year when feeds started to appear on prominent websites (with most of the public blissfully ignorant of them).

Sadly, it’s still safe to say that most new designs were done with table-based layouts and many table-less left much to be desired. Most of them are abusing or flatly ignoring semantic part of HTML tags and drowning in superfluous div’s. Little thought is spent on usability and even less on accessibility of new sites.

As customary by now, we seem to be lagging at least a couple of years behind the world. Slovenian web of 2005 is still very much the web of closed gardens. Feeds may have appeared, but their shy use is limited and there are few if any public APIs for developers to use.

I expect this will change in new year with public launch of Marela and hopefully other new services. Still, we’re not pioneers and it seems we don’t want to be.

On a personal front, it’s been a very busy, but also a very good year for me. Our service is about to go from a closed beta to more open one and first signs from our users are very positive. We started a series of web related talks through which I met many, from whom I’ve learned a lot. There’s more talent out there than I was aware of and it certainly gave me hope for the future.

I discovered the fun of writing and had a good fortune of having insightful readers who helped me tame my ignorance at least a bit. There were more of you reading this blog than I probably deserve and certainly many more than I’ve ever expected. I’m grateful to you all.

So to end this all, what are my blog resolutions for the new year?

I wrote more frequently than I first expected and probably should. In new year I’ll try to reduce the number of posts in favor of more useful content and prose that doesn’t feel like chewing cardboard.

I’ll try to write shorter posts except when content actually demands a longer one. I’d also like to hear what my readers would like to see more or less of so if you can spare a moment or two, please drop me a line in the comments.

I wish everyone all the best in new year.