More Tips #

Posted 21 Jun 2008 by Sven Latham

In a recent reader survey* the most popular articles on this blog are the ones which help with day-to-day technical problems. Here's a rundown of a few more handy tips while they sit on the ol' noggin:


Okay, that'll do for now.

* ie. Somebody left a comment.


HTTP Good Practise #

Posted 28 May 2008 by Sven Latham

Here's one for the web perfectionists out there. The usual line with HTTP and web browsing is that requests are achieved through the GET verb, and data modifications are through POST.

All well and good, but how do you handle text links that trigger a data modification? For instance, a page might have a list of items in a table, with "Edit - Delete" as associated actions. Edit is simple, it might go to edit?id=..., but Delete is more tricky. Assuming that no interstital "Are you sure" page is necessary, how can you trigger a POST from that Delete link?

My current way of tackling this is to include a form at the base of the page, and use some Javascript to submit that form. For instance

<a href="javascript:deleteItem(123)">Delete</a>

<form action="" method="post" name="jsPost">
<input type="hidden" name="action" value="">
<input type="hidden" name="item" value="">
</form>

<script type="text/javascript">
function deleteItem(id) {
document.forms['jsPost'].action.value="delete";
document.forms['jsPost'].item.value=id;
document.forms['jsPost'].submit();
}
</script>

This works fine and while the HTTP behaviour is roughly correct (okay, so in a perfect world I'd use the DELETE verb....) the code does not work for people not using Javascript.

Any ideas for a better, but clean solution?


BBC News Redesign #

Posted 31 Mar 2008 by Sven Latham


BBC News April 08 redesignFollowing on from the homepage redesign earlier this year, the BBC News site has been revamped to a 1024 pixel layout.


Personally, I find the amount of whitespace a little too overpowering; it's hard to see where section divides are (the regional "Around the World/UK Now" sections at the bottom, for instance)


I'm sure CSS purists will also dislike that this redesign still uses tables for layout, although the "Low Graphics" option still exists for any users who prefer it.


It seems this has just happened - none of the subsequent pages (Tech, UK, World, etc) carry the updated layout, but I'm sure it's only a matter of time. The BBC tend to keep old designs around for archived material, so looking back to articles from the 90s you can see the page as it was (albeit with a few SSI errors...)


Update:  Steve Herrmann from the BBC describes the changes