Category Archives: web development

All the Site in … One Request

Is it possible?

Yes it is! Actually I stumbled these days on a video where one of the guys talked about a quite interesting technique, that all the site was sent in one response from the server. But how is it possible? Actually everything is collected on the server side, i.e. with PHP which groups everything within a string. Obviously the images are base64ed. Than everything is send to the client with appropriate delimiters and mime types, and the client separates the string and build ups the page.

Problems

Of course there are some problems. First of all, as you may guess, MSIE doesn’t support base64. Another bad thing is that this isn’t cacheable.

One Good Use

There is however a good place to use this technique. In mobile versions. There is no much need of caches and most of all MSIE is not there!

CSS word-wrap to Wrap Long Words

So you have a very very long word in some HTML element:

verylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongword

As you can see what we miss is line breaks. This is a rare situation, but it may occur when you paste links or something. So the question is how to fix it.

Pure CSS needed

Simply add a fixed width and word-wrap.

width:400px;
word-wrap:break-word;

Now the result is obvious:

verylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongword

Secure localStorage? Now that’s a good question!

Nicholas Zakas posted today a very very interesting post about one of the most interesting and useful features in HTML5 – localStorage. What’s really impressing is that everybody’s using it, including me, with no fear of security. But security is never strong enough, so it’s quite interesting to listen up the guru!

I recently posted a localStorage wrapper for jQuery in form of a simple plugin. What I miss there is the security.

Definitely I’ve to change it a bit!