W3C Releases Mobile Web Best Practices

W3C Releases Mobile Web Best Practices: “

The World Wide Web Consortium (W3C) today released the 1.0 version of their Mobile Web Best Practices document. The guidelines offer mobile web developers a consistent set of best practices to apply when creating content for consumption on mobile devices. ‘The principal objective is to improve the user experience of the Web when accessed from [mobile web] devices,’ according to the W3C.

In Japan, there are already more mobile web users than PC users, and the rest of the world is catching up. Jupiter Research expects that mobile Web 2.0 revenues will hit $22.4 billion by 2014, with the biggest growth areas in mobile social networking and user generated content.

Developing content across such a wide array of mobile devices and creating a consistent and enjoyable user experience is not an easy task. The W3C hopes that its new mobile best practices guidelines will make it easier for developers to create content and applications for cell phones and other mobile devices.

‘Mobile Web content developers now have stable guidelines and maturing tools to help them create a better mobile Web experience,’ said Dominique Hazaël-Massieux, W3C Mobile Web Activity Lead in a press release. ‘In support of the W3C mission of building One Web, we want to support the developer community by providing tools to enable a great mobile Web user experience.’

The W3C also announced the release of the XHTML Basic 1.1 Recommendation today as the preferred markup language for the best practices document. ‘Until today, content developers faced an additional challenge: a variety of mobile markup languages to choose from,’ said the W3C. ‘With the publication of the XHTML Basic 1.1 Recommendation today, the preferred format specification of the Best Practices, there is now a full convergence in mobile markup languages, including those developed by the Open Mobile Alliance (OMA).’”

(Via SitePoint Blogs.)

Wenn zu viele in die Gestaltung reinquatschen

Wenn zu viele in die Gestaltung reinquatschen:

Ein köstlicher Film auf YouTube wird vielen Designern aus dem Herzen sprechen. Mailt diesen Link euren nervigsten Kunden.
Die Geschichte geht so: Wir nehmen an, es gäbe noch kein Stop-Schild für den Straßenverkehr. Eine der besten Agenturen im Land soll ein solches gestalten, mit Hilfe eines externen Kommunikationsdesigners. Es kommt zum Briefing, der ersten Präsentation … und dann folgen die endlosen Sonderwünsche aus der ersten Reihe Agenturseite , dem Management: research, usability-tests, Partner-Logos und so weiter. Das Ergebnis kann man erahnen … (via: Supertopic und Hoemmerich)

(Via Fontblog.)

8BitBoy – A Flash based Amiga Modplayer

Karsten Obarski invented 1987 – twenty years ago – the MOD format for his Ultimate Tracker running on Amiga computers. Since then, countless songs are created, especially for the demoscene.

MODs have special attributes. All samples are stored in 8bits and the number of voices is limited to four. To have something similarly to chords, the three notes of it are repeated very fast. This makes MODs sound so freaky.

Finally 8BitBoy brings those songs back online.

Screenshots mit diversen Browsern erstellen

Besonders für professionelle Web-Entwickler ist browsershots.org gedacht. Der Dienst macht auf Wunsch Screenshots einer Website mit einer Vielzahl unterschiedlicher Browser auf verschiedenen Systemen – und das zudem kostenlos.

Über 60 Browser stehen bei browsershots.org für den Test zur Auswahl. Optional kann man weitere Eckdaten bestimmen: die Bildschirmgröße, die Farbtiefe, ob JavaScript aktiviert ist und in welcher Version es vorliegt, ebenso ob Java und Flash vorhanden sind oder nicht. Standardmäßig sind die jeweils wichtigsten Browser der Plattformen markiert. Wer will kann per Klick alle Kandidaten von Linux, Windows oder Mac OS anwählen oder aber sich nach Rendering-Engine entscheiden und alle mit Gecko oder alle KHTML/WebKit-Browser nutzen.

Der Dienst ist kostenlos. Dafür hat man allerdings keinen Einfluss darauf, wie schnell die Screenshots zur Verfügung stehen. Wer 10 Euro bezahlt, wird hingegen einen Monat lang bevorzugt behandelt.

(Via hoemmerich.com)

»Drizzle« – Abspaltung von MySQL für Webanwendungen

Unter dem Namen “Drizzle” haben MySQL-Entwickler eine neue Version der freien Datenbank angekündig, die sich auf die aus ihrer Sicht wesentlichen Aspekte konzentriert. Brian Aker nennt in seinem Blog als Einsatzmöglichkeiten dieses abgespeckten MySQL-Servers Webanwendungen, Datenbanken ohne eingebaute Geschäftsprozesse, Cloud-Umgebungen und Multi-Core-Architekturen.
Anzeige

Viele Features, die in den letzten Jahren auf Druck von MySQL-Nutzern aus Unternehmen hinzukamen, fehlen in Drizzle: Stored Procedures, Trigger, Prepared Statements und Views. Auch der Query Cache fällt weg; er beschleunigt das wiederholte Ausführen derselben SQL-Befehle. Möglicherweise würden in Zukunft einige dieser Funktionen wieder eingeführt, es sei jedoch keine vollständige Kompatibilität mit MySQL geplant. Wichtiger sei es, Drizzle als echtes Open-Source-Projekt zu betreiben. Die Entwickler wollen wann immer möglich freie Bibliotheken benutzen; als Datenbank-Engine soll das transaktionsfähige InnoDB zum Einsatz kommen.

MySQL verharrt seit Längerem bei der Versionsnummer 5.0, die 2005 als Produktionsversion erschien. Seit zweieinhalb Jahren arbeiten die Entwickler an dem Nachfolger 5.1, der bislang wegen zahlreicher Fehler nicht zum Produktionseinsatz freigegeben ist. Vor Kurzem rief der Chef-Entwickler Monty Widenius MySQL-Anwender zur Hilfe bei der Fehlersuche auf. Parallel zur Arbeit an 5.1 verläuft seit Mitte letzten Jahres die an Version 6, die die selbstentwickelte transaktionsfähige Storage-Engine Falcon enthält. Deren Chef-Architekt Jim Starkey hat das Projekt jedoch vor Kurzem verlassen.

Bislang gibt es keine produktionsreife Version von Drizzle. Interessenten können sich den Code von Launchpad herunterladen. Zu den Entwicklern gehören neben Brian Aker Zak Greant, Monty Taylor und Jay Pipes. “Drizzle” ist das englische Wort für Nieselregen, der besonders häufig in Akers Heimatstadt Seattle auftreten soll.

Via heise online

Non-blocking JavaScript Downloads

Non-blocking JavaScript Downloads:

External JavaScript files block downloads and hurt your page performance, but there is an easy way to work around this problem: use dynamic scripts tags and load scripts in parallel, improving the page loading speed and the user experience.

The problem: scripts block downloads

Let’s first take a look at what the problem is with the script downloads. The thing is that before fully downloading and parsing a script, the browser can’t tell what’s in it. It may contain document.write() calls which modify the DOM tree or it may even contain location.href and send the user to a whole new page. If that happens, any components downloaded from the previous page may never be needed. In order to avoid potentially useless downloads, browsers first download, parse and execute each script before moving on with the queue of other components waiting to be downloaded. As a result, any script on your page blocks the download process and that has a negative impact on your page loading speed.

Here’s how the timeline looks like when downloading a slow JavaScript file (exaggerated to take 1 second). The script download (the third row in the image) blocks the two-by-two parallel downloads of the images that follow after the script:

Timeline - Blocking behavior of JavaScript files

Here’s the example to test yourself.

Problem 2: number of downloads per hostname

Another thing to note in the timeline above is how the images following the script are downloaded two-by-two. This is because of the restriction of how many components can be downloaded in parallel. In IE <= 7 and Firefox 2, it’s two components at a time (following the HTTP 1.1 specs), but both IE8 and FF3 increase the default to 6.

You can work around this limitation by using multiple domains to host your components, because the restriction is two components per hostname. For more information of this topic check the article ‘Maximizing Parallel Downloads in the Carpool Lane’ by Tenni Theurer.

The important thing to note is that JavaScripts block downloads across all hostnames. In fact, in the example timeline above, the script is hosted on a different domain than the images, but it still blocks them.

Scripts at the bottom to improve user experience

As Yahoo!’s Performance rules advise, you should put the scripts at the bottom of the page, towards the closing </body> tag. This doesn’t really make the page load faster (the script still has to load), but helps with the progressive rendering of the page. The user perception is that the page is faster when they can see a visual feedback that there is progress.

Non-blocking scripts

It turns out that there is an easy solution to the download blocking problem: include scripts dynamically via DOM methods. How do you do that? Simply create a new <script> element and append it to the <head>:

var js = document.createElement('script');
js.src = 'myscript.js';
var head = document.getElementsByTagName('head')[0];
head.appendChild(js);

Here’s the same test from above, modified to use the script node technique. Note that the third row in the image takes just as long to download, but the other resources on the page are loading simultaneously:

Non-blocking JavaScript timeline

Test example

As you can see the script file no longer blocks the downloads and the browser starts fetching the other components in parallel. And the overall response time is cut in half.

Dependencies

A problem with including scripts dynamically would be satisfying the dependencies. Imagine you’re downloading 3 scripts and three.js requires a function from one.js. How do you make sure this works?

Well, the simplest thing is to have only one file, this way not only avoiding the problem, but also improving performance by minimizing the number of HTTP requests (performance rule #1).

If you do need several files though, you can attach a listener to the script’s onload event (this will work in Firefox) and the onreadystatechange event (this will work in IE). Here’s a blog post that shows you how to do this. To be fully cross-browser compliant, you can do something else instead: just include a variable at the bottom of every script, as to signal ‘I’m ready’. This variable may very well be an array with elements for every script already included.

Using YUI Get utility

The YUI Get Utility makes it easy for you to use script includes. For example if you want to load 3 files, one.js, two.js and three.js, you can simply do:

var urls = ['one.js', 'two.js', 'three.js'];
YAHOO.util.Get.script(urls);

YUI Get also helps you with satisfying dependencies, by loading the scripts in order and also by letting you pass an onSuccess callback function which is executed when the last script is done loading. Similarly, you can pass an onFailure function to handle cases where scripts fail to load.

var myHandler = {
    onSuccess: function(){
        alert(':))');
    },
    onFailure: function(){
        alert(':((');
    }
};

var urls = ['1.js', '2.js', '3.js'];
YAHOO.util.Get.script(urls, myHandler);

Again, note that YUI Get will request the scripts in sequence, one after the other. This way you don’t download all the scripts in parallel, but still, the good part is that the scripts are not blocking the rest of the images and the other components on the page. Here’s a good example and tutorial on using YUI Get to load scripts.

YUI Get can also include stylesheets dynamically through the method
YAHOO.util.Get.css() [example].

Which brings us to the next question:

And what about stylesheets?

Stylesheets don’t block downloads in IE, but they do in Firefox. Applying the same technique of dynamic inserts solves the problem. You can create dynamic link tags like this:

var h = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.href = 'mycss.css';
link.type = 'text/css';
link.rel = 'stylesheet';
h.appendChild(link);

This will improve the loading time in Firefox significantly, while not affecting the loading time in IE.

Another positive side effect of the dynamic stylesheets (in FF) is that it helps with the progressive rendering. Usually both browsers will wait and show blank screen until the very last piece of stylesheet information is downloaded, and only then they’ll start rendering. This behavior saves them the potential work of re-rendering when new stylesheet rules come down the wire. With dynamic <link>s this is not happening in Firefox, it will render without waiting for all the styles and then re-render once they arrive. IE will behave as usual and wait.

But before you go ahead and implement dynamic <link> tags, consider the violation of the rule of separation of concerns: your page formatting (CSS) will be dependent on behavior (JS). In addition, this problem is going to be addressed in future Firefox versions.

Other ways?

There are other ways to achieve the non-blocking scripts behavior, but they all have their drawbacks.

Method Drawback
Using defer attribute of the script tag IE-only, unreliable even there
Using document.write() to write a script tag
  1. Non-blocking behavior is in IE-only
  2. document.write is not a recommended coding practice
XMLHttpRequest to get the source then execute with eval().
  1. eval() is evil’
  2. same-domain policy restriction
XHR request to get the source, create a new script tag and set its content
  1. more complex
  2. same-domain policy
Load script in an iframe
  1. complex
  2. iframe overhead
  3. same-domain policy

Future

Safari and IE8 are already changing the way scripts are getting loaded. Their idea is to download the scripts in parallel, but execute them in the sequence they’re found on the page. It’s likely that one day this blocking problem will become negligible, because only a few users will be using IE7 or lower and FF3 or lower. Until then, a dynamic script tag is an easy way around the problem.

Summary

  • Scripts block downloads in FF and IE browsers and this makes your pages load slower.
  • An easy solution is to use dynamic <script> tags and prevent blocking.
  • YUI Get Utility makes it easier to do script and style includes and manage dependencies.
  • You can use dynamic <link> tags too, but consider the separation of concerns first.

(Via Yahoo! User Interface Blog.)

Conditional Comments for HTML Email

Conditional Comments for HTML Email: “

Take a look at this:

<!--[if gte mso 9]>

<![endif]-->

Chances are the general syntax will be instantly familiar — it’s a conditional comment, useful for feeding specific content only to Windows versions of Internet Explorer. But did you know they work for Office applications too?

Neither did I … until recently.

We’ve just overhauled the HTML templates for our email newsletters … a painful process to be sure — if you think that web browsers are harsh task-masters, you should try coding to suit email clients! A recent article, How to Code HTML Email Newsletters, spells out just how convoluted it can be, and how arcane are the techniques you have to resort to, to produce a decent layout in the most popular email clients. And the issue has been further complicated by the fact that one of the most popular Windows clients — Outlook — no longer uses Internet Explorer for HTML rendering, it uses Word!

And it was while perusing the franken-code that passes for ‘Save as Web Page’ output from a Word document, that I first saw these little nuggets — exactly what we needed to hide bits of content from Outlook that were just too mangled to leave.

So there you go. If you’re publishing HTML email and struggling with Outlook’s rendering, here’s an extra little tool for the kit. The syntax even implies that it can be used for granular targetting of Office versions all the way back; but I haven’t tested this, so any information is gratefully received :)

(Via SitePoint Blogs.)

YUI! Graded Browser Support Update

Graded Browser Support Update: “

This post announces an update to Graded Browser Support. The GBS page on the YUI site always has the most current information. This post includes a list of primary changes, the updated chart of browsers that receive A-grade support, the GBS forecast, and notes specific to the YUI Library.

Primary Changes

These changes are included in this update.

  • A-grade support for Firefox 3 begins.
  • A-grade support for Firefox 2 is reduced to Win XP and Mac 10.5.
  • A-grade support for Opera 9.5 begins on Win XP and Mac 10.5.
  • A-grade support for Win 98 is discontinued, as previously forecast.
Win 2000 Win XP Win Vista Mac 10.4 Mac 10.5
Firefox 3.† A-grade A-grade A-grade A-grade A-grade
Firefox 2.† A-grade A-grade
IE 7.0 A-grade A-grade
IE 6.0 A-grade A-grade
Opera 9.5† A-grade A-grade
Safari 3.0† A-grade A-grade

The dagger symbol (as in ‘Firefox 3.†’) indicates that the most-current non-beta version at that branch level receives support. Put another way, † means ‘the most recent’ instead of ‘all.’

GBS Forecast

In addition to the effective-immediately changes, we’re keeping our eyes on pending developments.

  • Internet Explorer 8

    GBS does not extend A-grade support to beta versions of browsers. (They receive X-grade support by definition.) However, it’s important to be aware of forthcoming releases, especially from established brands that enjoy rapid adoption once generally available (GA). We are currently watching the development progress of Internet Explorer 8.

    We made an exception to our ‘no-betas’ stance during IE7’s beta phase in recognition of IE’s market share and ability to promote rapid adoption. The exception — committing development and QA resources to provide A-Grade prior to a GA release — gives us an opportunity to learn the new browser’s quirks and provide feedback while it is still being developed. And it means our sites are prepared when it goes GA. We will likely extend the same accommodation to IE8. Stay tuned.

Notes Specific to the YUI Library

  • YUI version 2.5.2

    YUI 2.5.2, released May 28, 2008, includes full support for Firefox 3.0 and Opera 9.5, even though those two browsers were just added to GBS in this update.

(Via Yahoo! User Interface Blog.)