A notch above a monkey

Firefox and defer="defer"

If you’re sitting in the wrong part of the world, then Google might be inaccessible to you right now. That would be only a minor annoyance, if the same wasn’t true also for Google Analytics.

It’s remarkable how many sites (including this one) use it and are right now more or less inaccessible to every poor soul suffering from Google blackout. That’s because browser can’t tell if external Javascript will use a method like document.write and therefore blocks rendering until the code is loaded or it timeouts waiting for it.

There should be a workaround for times like this and according to HTML4 specification there is one . By using defer=”defer” we can signal to the browser that it can safely proceed rendering the page, because we won’t be using any dangerous methods in our Javascript files.

However, it sadly doesn’t work everywhere. It works in Internet Explorer, but fails in Firefox and Safari. And that simply sucks.

/code

I find searching through blogs for pieces of usable code rather unfriendly and I think I’m not the only one. That’s why I added a new section to my homepage, where I’ll publish useful or semi-useful pieces of code.

Revisiting javascript i18n

This week I had an interesting discussion with Ratnadeep Bhattacharjee about my previous try to solve javascript i18n needs and it quickly become obvious that my library is not sufficient and likely also wrong approach to the problem.

There are at least two unresolved issues with my current javascript i18n library:

  • It doesn’t detect browser language settings and act accordingly.
  • It’s one way only. After you changed the language used, you can’t change it again easily.

I’m sure these are not the only two problems, since I have a vague uneasiness about a few more things. Therefore I’d love to hear more thoughts about what you’d expect and need from such a library, before I continue down the possibly wrong path.