Posterous theme by Cory Watilo

Filed under: Web Development

The end of BlackBerry

If you develop websites, you can’t count on any consistency from one BlackBerry model in terms of HTML and JavaScript functions, so you likely don’t even try.

We do try and phones like these will just get what they support as far as Web Standards go. Their users probably will get tired of the 'lesser browsing experience' and move on to something better next time their contract is up for renewal.
Or not.

jQuery appendTo

Recently I ran into an issue where dynamically loaded CSS files were not being executed/rendered in IE6-8. The loading of that file happened with a line in jQuery code using appendTo. With jQuery 1.4 however this stopped working and so far to my knowledge this has not been fixed.

A work-around would be to just revert to plain good old fashioned javascript like the code below

<script>
var headID = document.getElementsByTagName("head")[0];
var cssNode = document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = 'presentation/css/js-enabled.css';
cssNode.media = 'screen';
headID.appendChild(cssNode);
</script>

Box-shadow weirdness

Recently I came across an oddity regarding using box-shadow on an element.

It turns out that in Firefox (3.6) when you use a box-shadow on an element with no width – it stretches across the screen – it causes a horizontal scrollbar to appear. This did not happen in Safari.

First I thought this meant in FF the width of the element with shadow was actually wider but after a few short tests this is not something I can confirm: set on fixed width elements the computed value did not change and used on floated columns it did not cause the 2nd column to float under the first.

So it seems this is only an issue with elements without width set and thus taking up the whole available width of the screen.