Simon's articles

  1. Closures and executing JavaScript on page load

    Over on my other blog I’ve just published a new technique for executing a piece of JavaScript once a page has finished loading. Here’s the code: function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != ‘function’) { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } addLoadEvent(nameOfSomeFunctionToRunOnPageLoad); […]

  2. Getting creative with visited links

    Many web developers instinctively start a new stylesheet by declaring the style of links and visited links in a single statement: a:link, a:visited { /* rules here */ } Doing this avoids the tricky issue of picking a subtly different (but at the same time visually obvious) colour for visited links, but also kills off […]

  3. This week’s useful resources

    HTML and XHTML both impose rules on which elements can be contained within which other elements. The definitive guide to these rules are the various DTDs (Document Type Definitions) that govern the different flavours of HTML. Unfortunately, DTDs aren’t exactly friendly to read. Enter Cameron Adams’ brilliant DTD Mapper, which presents an easily navigated tree […]

  4. Understanding Unicode

    One of the tougher issues on the modern web is that of internationalization, often shortened to i18n (‘i’, then 18 more letters, then ‘n’). The world-wide web truly lives up to its name, and even if your site has a local audience you still may find yourself dealing with foreign letters, be they names with […]

  5. Clearing Floats

    A frequent point of confusion with the CSS float model is the need for a “clearing” element beneath something that is floated if you want the containing element of the float to fully contain it. Eric Meyer’s Containing Floats provides an excellent explanation of this issue. Unfortunately, the standard method for dealing with this involves […]

  6. W3C Validator Update

    The W3C Markup Validator is a powerful tool for checking that your XHTML or HTML is free of errors. Unfortunately, it suffers from extremely unfriendly error messages which can make it hard for newcomers to validation to understand the problems with their markup. The team behind the validator released a brand new version yesterday which […]

  7. CSS Sprites

    One of the most exciting techniques to emerge from the CSS community in recent months involves using a single large background images as a container for several smaller images, then using the CSS background position properties to show different parts of the larger image in different places (and different hover states) around a page. To […]

  8. Evaluating CSS Hacks

    Vincent Garcia reports on a CSS hack for Safari (discovered by Anne Van Kesteren) which provides support for the min-height property by taking advantage of the CSS 2.1 table model. IE/Windows doesn’t support the table model, but treats heights as min-heights anyway. Vincent explains the hack further in his entry. With any CSS hack, it’s […]

  9. Crazy CSS

    There’s a long tradition in the CSS community of pushing CSS to its limits to discover new tricks. These experiments are inherently valuable, as no matter how bizzare or useless they may seem they help improve people’s understanding of exactly how CSS works. Case in point: Chris Hester’s CSS Pencils, where CSS and a lot […]

  10. Odds and ends

    A few links I’ve found interesting or useful over the last week: Inserting at the cursor using JavaScript This is a highly effective trick for enhancing the usability of forms, the topic of my recent SitePoint article. It’s particularly useful for text entry fields for content management systems – for example, providing users with an […]

  11. What you should know about CSS 2.1

    CSS 2 revision 1 has been out as a candidate recommendation for nearly two months now, but there’s been surprisingly little discussion of it around the web. It’s an interesting specification, and one that any standards conscious web developer should be aware of. CSS 2.1 revises CSS 2 to better reflect the current state of […]

  12. Javascript and Security

    Dori Smith has a great entry on her Javascript Weblog about using Javascript to secure pages of her site. She argues that Javascript really isn’t the right tool for the job, and I completely agree with her. However, it is possible to yse Javascript to further improve the security of a server-side login system. Unless […]

  13. Bookmarklets

    My latest SitePoint article is up: Better Living Through Bookmarklets. I’m a huge fan of bookmarklets and the article details some of my favourites and demonstrates some tricks for writing your own. In the short time since I wrote the article I’ve come across a couple of new bookmarklets that deserve a mention. Mouseover DOM […]

  14. Better Living Through Bookmarklets

    Bookmarklets add functionality to your browser, and can help smooth your workflow. Here, Simon identifies handy bookmarklets, provides tips to build your own, and demonstrate advanced techniques for leveraging these powerful tools.

  15. Enhancing Javascript’s built in types

    Javascript is often falsely derided as a simple language, devoid of the object oriented features so favoured by other modern scripting languages. People holding this opinion really need to take another look at the language, for beneath its beginner friendly interior Javascript packs some powerful language features. In addition to its support for functional programming […]

  16. Don’t use client side includes!’s Using Client Side Includes instead of Server Side Includes makes the case for replacing server-side techniques for including common page components with alternatives powered by Javascript. My advice: stay well clear. While Javascript includes may reduce the load on your server slightly and may even increase page loading times due to additional client-side caching, […]

  17. Mishoo on fighting IE bugs

    Mishoo is an interesting guy. He’s the principle developer behind HTMLArea, a popular textarea replacing rich text editing widget. He’s also the author of my favourite DHTML Calendar, and his site carries a bunch of other scripts and shows off some seriously impressive DHTML wizardry. He frequently writes about cross-browser DHTML development, and his most […]

  18. Lessons learnt

    Just in case anyone had any doubts, yesterday’s entry was most definitely a joke. David Siegel was indeed an internet legend back in the late 90s, pioneering techniques that led the web kicking and screaming in to a commercial age of visually appealing sites that defied the limitations of the original HTML specification. Those tricks […]

  19. Tips from the master

    I stumbled across a real gem today: Tips for writers and designers from HTML wizard David Siegel. David is driving forward the boundaries of web design and has a treasure trove of tips for aspiring web developers. Did you know you could use single pixel gifs to achieve perfect control over your layouts? The companion […]

  20. Drag and drop with Javascript

    Walter Zorn’s Drag & Drop is a DHTML API which makes it easy to add extensive drag and drop functionality to any element on a page. The API supports dragging and resizing and also provides Javascript methods for programmatically moving and resizing elements. It works on an impressive range of browsers right the way back […]

  21. Flexible Floats

    Dunstan Orchard has an interesting twist on the floated image gallery technique, originally introduced by Mark Newhouse back in August 2001 (was it really that long ago?). Floated image galleries use floated thumbnails to create a layout that appears to use table style columns, but dynamically reorganises itself as you resize the page. Dunstan’s variation […]