PHPdom

I got a-thinking the other day (I do that occassionally) and thought how great it would be to be able to separate content from code – HTML from PHP – in a similar way to asp.net. Of course that quickly led me onto thinking about the Document Object Model, which allows JavaScript to interact with a HTML document and manipulate the content.

The obvious stuff would be there: innerHTML, getAttribute, setAttribute, appendChild, removeChild, getChildNodes etc. Fantastic, I thought, I could keep my logic and database-y stuff complete separate from nice clean template documents. It would be a revolution for PHP, and I would be hailed as a genius.

It’s a good job that I had a quick search to see if anyone else had done it, as someone definitely has. Not to mention it’s even part of the PHP5 core (OK, that’s actually for XML documents, but could be mangled to work with XHTML).

This has taught me two things:

  1. I’m not nearly as clever as I think I am
  2. Searching the web before opening my mouth proclaiming how great I am might save me from looking like a pillock

Quick introductions to web technology

A friend of mine from the GAWDs community is in the process of setting up a new directory website (well, it’s much more than that, but you’ll have to head over there to get the full picture). There are some useful articles on his site explaining various aspects of web technology, here are some you might find useful:

And there’s more where they came from. Everyone say “Thanks, Vince!”.

New picture albums – Whitby and Guernsey

I’ve spent a couple of minutes adding some new picture albums to my gallery. They are specifically for people that love the sea, as they are both of places deeply involved with maritime living.

Firstly I have a few pictures of beautiful Guernsey, the lesser-known Channel Island. We wnt there for a holiday in late August 2005 and had a wonderful time. I’d really like to go back and explore some more, as I’m sure we only saw a fraction of it – despite it being pretty small.

There are also some pictures of Whitby, North Yorkshire. Whitby is one of my wife’s favourite places, so we’ve been quite a lot. It’s famous for being the birthplace of Captain Cook who sailed round the world a lot, and for featuring in the original Dracula novel. In fact when these pictures were taken it was the yearly Dracula festival weekend and so there were plenty of people walking round in Goth outfits. In fact one particularly morbid bunch were driving round town in a hearse. I’ve stuck with pictures of the town and harbour, though.

I have a couple more collections to put up in the next few days, and as I’m a tidy sort of bloke they’ll all be grouped together in my new graphics category.

I’ve seen the future; garlic bread

There’s been some broohaha over the future of HTML. To say the least it’s been going on a while and has caused no small amount of disagreement in the web world. However a concensus seems to be on the horizon that HTML5 is the way forward, thanks mainly to the WHATWG.

I’ve taken a few moments to go through the specification for HTML5 and picked out some of the new structural features I’m most looking forward to using.

Pre-defined class names

I pretty much use all these class names every day, and I think that the vast majority of standards-aware developers do, too. What this amounts to is almost a kind of page-wide microformat, adding another layer of semantics to the page. Bring it on.

The nav elements (and the header and footer elements)

While I think this is a good idea I’ve got something in the back of my mind telling me that this is just over the line of too much semantics. Why I’d think that I’m not sure, probably years of writing <div id="nav">. It would make creating media-specific layouts much simpler, though.

The dialog element

This has pretty limited use, but I guess that in the future online dialogues will make up more and more of the content fo websites. That’s if people wake up to the power of user contribution. Being able to easily gather all these dialogues from across the web could provide the data needed to generate a web-wide conversation map. That’s just another way of seeing the connections that bind us all together.

The meter elements

I smell a whole new set of native graphing techniques in browsers. And here’s a prohecy for you, Apple’s Safari browser will do it first and make it look cool (closely followed by Opera).

The mighty canvas

It’s here already, thanks to support in a couple of the more forward-thinking browsers (even if it is buggy and limited) so there are high hopes for this little beauty. Again, it opens the way to all manner of graphical goodness.

The datagrid

There’s not much I can say about this as my brain has melted. If it’s implemented as thoroughly as the specs say it should be then this could revolutionise a lot of web application development by itself.

Anyway, take a look at the specs yourself. This looks like the future, and it looks good.

The Village Soup

The estimable Nathan Smith has just written a really interesting article on Digital Web Magazine called The Village Stew. Suffice to say I’ve been that chef on a number of occasions, and it’s galling to see what would otherwise be a great dish get messed up by the inclusion of myriad random ingredients. As these guys would say; keep it simple.

It’s a shame that web designers and developers are seen in this way – as people with unimpressive skills, a commodity. After all, the world is being changed precisely because of what we make happen (even if the original ideas may come from someone else). Nathan outlines some of the problems we can face when working in a large organisation, and some ways we can mitigate against having our work over-commiteeised.

Of course not all projects and clients are going to be a dream to work with, so we need to be prepared for the problems we could encounter along the way. Until web developers and designers are rightly given the same respect as, say, architects, we’ll just have to take the rough with the smooth.