October 2007
Monthly Archive
Monthly Archive
Posted by Sam on 13 Oct 2007 | Tagged as: Web development
Some more updates to the site:
The last item on the list was interesting. For some odd reason, my JS that worked perfectly well in Fx and Safari was failing miserably (without an error) in IE7 and Opera. The script basically just retrieves the following element with getElementById:
<p id=”copyright“>Copyright ©2005-2007 Sam Maister, All Rights Reserved.</p>
…before adding extra padding (via inline CSS) to ensure that it is at the bottom of the page, if the content is too small to push the element to the bottom. So I tried a few things out such as changing the element to a div, removing the existing applicable CSS rules, using ye olde document.all.getElementById, etc. None of these worked, and I quickly realised that the existing method did actually work, just not on that particular element. So I tried a couple more things before changing the id of the element from ‘copyright’ to something arbitrary; I didn’t expect this to work at all, but work it did. To test my theory, I changed the id of a different element to ‘copyright’ and that element was now immune to the script…bizarre; for some reason IE and Opera (maybe through some misguided attempt to be more IE-like?) seem to ignore any attempt to retrieve an element with an id of ‘copyright’ through getElementById. Googling it came up with nothing, but whatever. Now I have ‘copyright_notice’ and everything is peachy.
Here’s a simple testcase:
inline JS – var copy=document.getElementById(‘copyright’);
var notcopy=document.getElementById(‘this_copyright_bug_is_stupid’);
copy.style.color=’red’;
notcopy.style.color=’red’;
Clicking here should change both of the following text lines red. Click here to reset the colours:
I have an id of ‘copyright’.
I have an id of ‘this_copyright_bug_is_stupid’.
Edit: Another reason I should really be using jQuery for all of my JS stuff; this bug doesn’t occur when you use $(“#copyright”).css(“color”,”red”); instead of the clunky code above.
Posted by Sam on 11 Oct 2007 | Tagged as: Life, Web development, Work
Ok…so I’ve been rather silent here. I’m still alive, currently living in Edinburgh with my new lady (who is the best thing to happen to me in a very long time). The MSc and DoD (Dissertation of D0000000m) have ended and I am sans job. I’m involved in a concerted effort to get a position in web development as I’d like to work in an area that
The site has come along a great deal since I last wrote something here, with eleventy billion bug fixes and extra features, and some actual design work has happened to ensure that it doesn’t look like a pile of junk. It’s far from finished – I have several little bits yet to do, along with the mildly irritating task of getting it to look nice in the abomination that is IE6. In fact I would have done the IE6 testing already if M$ hadn’t made it impossible to run it in Vista; as it is, I have to install 1.5+Gb of virtual OS (XP SP2) to get anywhere near IE6. So I’ve decided not to bother and to gopher the prettiest Linux ever (Kubuntu) and WINE instead. After these job applications. Job > IE6 compatibility.
Anyway, here are the main recent improvements to the site:
The WordPress update to 2.3 didn’t work (both 1-click & manual) so I’ll stick with 2.2.1 until I figure a workaround (probably best backing up, deleting and re-installing). More to come.