• Client login
  • Work for us

All the latest from the team...

Tuesday, 16 September 2008

Internet Explorer and elements named "description"

OK I'm not entirely sure why I've never come across this before but it's a classic "Internet Ignorer" bug...

When doing Javascript validation on a form recently we had a field named (& id'ed) "description"

<textarea name="description" id="description"></textarea>

Subsequently we attempted to validate the value of this field in JavaScript...

if(document.getElementById("description").value!=""){...}

Well it turns out that this returns the meta description tag for Internet Ignorer ("undefined" for the value)... Marvellous! Well there is a workaround, either rename your field or, simply override the nativeGetElementById method for Internet Ignorer... Check out Sixteen Small Stones

Labels: , , , ,

Friday, 16 May 2008

Quite possibly the best CSS "hack" I've ever used...

After a good couple of days banging my head against the desk trying to figure out a solution to a Windows Safari "bug" I think I may have found the best CSS "hack" ever...

Ever wondered why Safari renders fonts bolder than all other browsers on Windows? Well it's down to a setting hidden away in the preferences dialog shown below:



Which is great if you can control everyone's install of Safari but, well let's face it - you can't. Which left me with the dilema... how the hell do I get the headers on my website to render as expected in Safari? Well fear not - just add the following line to your css:

text-shadow: 0 0 0 #FFF;

Where #FFF is whatever the background colour your text appears on and voila Safari's nasty aliasing "bug" has vanished!

Labels: , , , , , ,

RSS feed ATOM feed Add to Technorati Favorites View Jon Harvey's profile on LinkedIn