April 15, 201016 yr I have a requirement to display an email address on screen in the markup. What's the most effective way to combat it being spidered? • using the acsii version in the source? • using an image of the email address? • using javascript to spit it once the page is loaded? I need a fairly simple solution so don't really want to get involved with server side solutions. My thoughts I've used images in the past, and they've been full proof. But IE seems to be muddy when displaying some images, which doesn't look good when the email addres shows as crisp clear anti aliased text (eg screenshot taken from firefox). I'm happy to use the ascii version, but I'd be keen to hear users experiences with results. If you've any javascript examples I'd be happy to impliment something simple, although I'd rather have something written in the markup.
April 15, 201016 yr I've used javascript in the markup for many years for my email address (and for email addresses of other people) and haven't knowingly had spam. This is what I used:- <script type="text/javascript"> <!-- // protected email script emailE='myname' emailE=(emailE + '@' + 'hotmail.com') document.write('<a href="mailto:' + emailE + ' ">' + ' myname@hotmail.com' + '</a>') //--> </script> <noscript> <p><i>Email address protected by JavaScript. Please enable JavaScript to contact me.</i></p> </noscript> If the email address is your own, then consider a PHP web form which will hide the address from a viewer, but if the address is for someone else, then a web form would not be appropriate. However, I use a web form now for my own email address and I understand that document.write is out of date javascript, but the javascript method is still on some of my old websites and works well.
April 15, 201016 yr Author I've used javascript in the markup for many years for my email address (and for email addresses of other people) and haven't knowingly had spam. This is what I used:- <script type="text/javascript"> <!-- // protected email script emailE='myname' emailE=(emailE + '@' + 'hotmail.com') document.write('<a href="mailto:' + emailE + ' ">' + ' myname@hotmail.com' + '</a>') //--> </script> <noscript> <p><i>Email address protected by JavaScript. Please enable JavaScript to contact me.</i></p> </noscript> If the email address is your own, then consider a PHP web form which will hide the address from a viewer, but if the address is for someone else, then a web form would not be appropriate. However, I use a web form now for my own email address and I understand that document.write is out of date javascript, but the javascript method is still on some of my old websites and works well. hey thanks for the reply. yes the address will belong to the site owner, but the requirement is for it to be displayed in the browser as well as web form. i'll look into a javascript method, thanks!
Create an account or sign in to comment