Posts tagged as Quick Tips

Stop mail clients auto-linking text as URLs

Wow – it’s been a while since I last posted…

This is just a quickie – a reminder for my own reference, but could also be useful to others.

I’m building a shop, and the email confirmations include the line:

Your credit card statement will show a payment to "MYDOMAIN.COM".

Which is fine, except that many mail clients (e.g. Apple Mail) will take MYDOMAIN.COM and link it as a URL – which I don’t want.

To avoid this, simply add a zero width space into the “URL” – for instance:

Your credit card statement will show a payment to "MYDOMAIN​.COM".

(That’s the HTML version. If you’re generating a plain text alternative (using CFML, of course), you’ll want to use #Chr(8203)#).

The text will now look identical – except it will not be linked by the mail client.

2 comments Posted on 9 February, 2010, in Quick Tips, HTML

Handling initial display states for jQuery-enhanced pages

When building a jQuery-enhanced site (or using any other JavaScript library, for that matter) I find one of the tasks I use jQuery for is to set the initial display states of various elements on the page.

For instance, you may have some elements that should only be displayed if JavaScript is enabled; and some which should be hidden. But what do you do to avoid the flash of unwanted content which may appear before various libraries load? Here's my solution...

Read more »

5 comments Posted on 26 August, 2009, in JavaScript, Quick Tips, jQuery