Join the HTML Dog Mailing List to receive updates about latest additions to the website by sending your .

Privacy Policy

You are here: Home

Titan InternetHTML Dog is hosted by Titan Internet. Highly recommended they are too.

August 2004 Archives

Avoiding Email-Link Spam

The problem with putting email address links (<a href="mailto:someone@somewhere.com">someone@somewhere.com</a>) on web pages is that they'll be added to spam lists. In the same way that a search engine will trawl through pages to find links, "spambots" will slither their way through the net to collect email addresses for evildoing.

I have a few addresses I've used for years that get a LOT of spam, and that's due mainly to those addresses appearing on web pages. It's the reason that a lot of web sites (including HTML Dog) avoid using them. It's a shame. Sometimes you really want to include an email link on a web page. Sometimes a contact form isn't good enough on its own - you want to open up as many contact options as possible.

When using email links, there are two main ways of cutting down on potential spam. The first is to use special characters in place of normal characters, but it's not as effective as the second method - using JavaScript.

The examples I found on the net aren't great. What we really want to do in this day and age is cut out event attributes and inline JavaScript code and take full advantage of the DOM - pulling the code out of the page altogether.

So on a recent project I used this code and threw it into a separate JavaScript file:

function view_address() {
	address_to_replace=document.getElementById("e").firstChild;
	real_address=address_to_replace.nodeValue.replace("[at]", "@");
	address_to_replace.nodeValue=real_address; 
	address_to_replace.parentNode.setAttribute("href", "mailto:"+real_address); 
}
window.onload = function() { view_address(); }

And then in every HTML page there is an a element that looks something like:

<a id="e">pooba[at]chunkysoup.co.uk</a>

On the unusual occasion that JavaScript is not enabled, the user will be confronted with an understandable (not perfect, but better than nothing) email address. When JavaScript is enabled, the HTML is replaced with code that effectively resembles <a id="e" href="mailto:pooba@chunkysoup.co.uk">pooba@chunkysoup.co.uk</a>. It's just a normal email link as far as a human visitor is concerned. Most spambots, on the other hand, won't recognise them and won't add them to their lists.

This single-email-link-per-page (in a "contact us" section) serves my purposes, but there are obviously lots of variations on this DOM theme. If anyone has ideas for more generic code, please comment away.

Tuesday 31 August, 2004 (12:40 PM GMT) | Comments (38) / Permanent Link

PHP and Web Standards

Dan Webb has written an interesting post about the attention the web standards community gives to PHP. To sum-up the points that Dan (both in the post and the comments) and the article he references, PHP is not suitable for large-scale web sites and the web standards community should not get carried away by it.

I disagree with a lot of the points of the article, but Dan knows a damned sight more about back-end programming than I do, and that's partly the point.

Most web-standards evangelists are front-end design, HTML and CSS experts. They are not, and cannot be expected to be, back-end experts. If I want help with back-end development (including PHP), I don't think that the likes of Mezzoblue or A List Apart are the best places to look for it.

But PHP can be picked up relatively easily and I think that's why chiefly front-end developers (including myself) have embraced it. When it comes to large-scale, commercial (usually e-commerce) sites though, is PHP good enough?

Tuesday 24 August, 2004 (11:08 AM GMT) | Comments (17) / Permanent Link

Writing for the Web

After writing the previous post and putting it up, I realised how long it was and how completely disinterested in reading it I would be if I came across it.

Man, I don't half ramble sometimes.

Writing for the web is different to writing for any other medium.

Apart from good content, what makes you interested (or disinterested) in reading something on the web?

Tuesday 17 August, 2004 (10:04 AM GMT) | Comments (17) / Permanent Link

World Wide Web Standards

Meeting up with some well-known UK bloggers this weekend has inspired me to get off my arse (or rather get on it) and get back into posting on the Dog Blog. If I've got enough time to play twenty games of Freecell or Reversi a day, I've got no excuses.

The meet-up was great. It's always nice to put a face to work you have been reading for some time (Ah! So that's what Jon Hicks looks like!). Discussions covered a plethora of topics. Is usability really that important? Are certain recent blog redesigns good or ghastly? If we all went to SXSW next year, should we go as tweed-adorned aristocrats or as tattooed, shaven-headed football hooligans? Is it worth paying the extra money for a Canon Eos 10D over a 300D? And who uses a 3,200 ISO anyway? Hey! Wasn't that Keira Knightley? She's much spottier in real life.

Not that it was ever in doubt, the meet-up confirmed that these are very intelligent and passionate people. Being at the forefront of web design, they have a genuine interest in how to do things in the best possible way, pushing web technologies and design principles as far as they can possibly be pushed. They are people that really know what they're talking about, and, luckily for the rest of us, they also know how to clearly communicate their knowledge and opinions to others.

The pro-web standards voice in the UK has become quite a loud (yet intelligent and eloquent) one of late, with some blogs becoming incredibly popular and other ones bursting onto the scene and making quite an impact.

Without wanting to sound like a queen loving, Cliff Richard listening, Union-Jack boxer-short wearing extreme patriot, I'm proud of the UK's contribution to the recent good-practice standards revolution and I'm proud that I can be a part of it. If there were a Web Standards Olympics, our team would be a serious medal contender.

The UK contribution is an example of an increasingly widening interest-base. Web standards was once an area very much lead by America (as general web design was in the mid to late 1990's) but is increasingly becoming a much more international community.
Obviously, there is still a large number of high-profile bloggers, authors and general campaigners who hail from the USA. And Canada has the likes of Dave Shea and Joe Clark. Australia (especially thanks to the Web Standards Group, I think) also stands out, with an impressive number of recognisable names (such as Russ Weakley and Cameron Adams) for such a relatively small and widely dispersed country. Germany and the Netherlands also seem to have a fair few standards enthusiasts tucked away.

There does seem to be various levels of interest from different nations (why doesn't this site get a lot of visitors from Mauritius?). There are obviously lots of factors involved in this, the main ones of which I would assume are the state of the economy (as in, the demand for such web page optimisation) and the size of the population (there's a greater likelihood of finding someone interested in web standards in the USA than there is in Vatican City, for example).

But is it important? Well, yes and no. If you've got access to the Internet and you're learning something from an on-line article, it doesn't matter where you're from (as long as you can read the article) and chances are you won't care too much about where the author comes from. And when you write an article, a blog, or contribute to a mailing list, you're sending out a message across the globe. Even books (paper? what's that?) can very easily be written by someone in Fiji for an American publisher and picked up at a local bookstore in Prague by a South African, who will be most interested in good content rather than where the book has come from.

But here's the thing - I have national pride. You most likely have national pride. Most people still feel some affinity with the country in which they live or come from, even though the influences on our every day lives are becoming much more multi-national. I like to contribute to something and take pride in what I do and I also like to think that anything I do in life is not monopolised by one country.

And on a more subtle (but logical?) level, cultural differences lead to different perspectives and a richer, more interesting experience.

Sunday 15 August, 2004 ( 5:29 PM GMT) | Comments (9) / Permanent Link

See Also

^ Top

Join the HTML Dog Mailing List to receive updates about latest additions to the website by sending your .

Privacy Policy

Titan InternetHTML Dog is hosted by Titan Internet. Highly recommended they are too.