Your e-mail address hidden with jQuery?
Last week we published an article with different methods to hide e-mail addresses on websites. Because of several comments with suggestions on how-to solve this problem, we provide this week a solution which is “from these days” and more powerful.
Based on the idea if you don’t show an address, a spambot can’t see it, we use in our example a simple Ajax call (using jQuery) and show a tiny box with some friendly message including the link with e-mail address.
DEMO: We used the code from this tutorial on the this page.
How does it work?
First we need to create a simple php file that holds the content and the e-mail address, we use json_encode to make the string less readable:
< ?php // change the two vars below $email = 'user@mail.com'; $html = 'Please contact us by e-mail: <a href="mailto:%%mAdr%%">%%mAdr%%<br /><br /> <a href="javascript:void(0);" id="hideme">Close</a>'; $eparts = explode('@', $email); $data = array('ename'=>$eparts[0], 'dom'=>$eparts[1], 'htmlcode'=>$html); echo json_encode($data); ?>
Don’t forget to block that file in your robots.txt file!
Read the rest of this entry »
Learn how transactional emails work.
Latest Articles
- E-mail links, protective solutions against SPAM
- Google Custom Search in a Lightbox!
- How-to choose a WordPress Hosting Provider
- jQuery Contact form for your website
- Ajax requests using jQuery and PHP
- Search for photos using PHP and the flickr API
- Website Monitoring Services: Reviews and Facts
- Create custom reCAPTCHA images using their API
- Adsense for WordPress - 5 Plugins reviewed
- Top your sales with Google Commerce Search
- How-to create a Password Generator using PHP
- Add a Google Sitemap for your Posterous Blog
Popular Tags
adbrite adsense Advertising ajax api bbpress blog book review cms css curl database directadmin dns domain e-mail eCommerce forum ftp gadgets generator google hosting internet IP address jquery links modules mysql php phpmyadmin plugin register review scripts search seo shopping cart social sites spam templates themes thickbox traffic upload Web 2.0 webmaster website monitoring wordpress wordpress themes







