<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>~chuck/blog &#187; html</title>
	<atom:link href="http://www.ozymo.com/explosions/tag/html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ozymo.com</link>
	<description>What more could you want?</description>
	<lastBuildDate>Tue, 17 Oct 2023 03:57:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Client-side mailto: Link Encoding in HTML Pages</title>
		<link>http://www.ozymo.com/explosions/7</link>
		<comments>http://www.ozymo.com/explosions/7#comments</comments>
		<pubDate>Thu, 31 Jan 2008 03:15:38 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[webmaster]]></category>

		<guid isPermaLink="false">http://www.ozymo.com/~chuck/blog/?p=7</guid>
		<description><![CDATA[This always seems to be a sore subject among webmasters, and I have seen some quite silly contrived solutions: addy@DELETE_THISdomain.com mayemail @ mydomain com Please contact us for contact information To me, these seem very creative (except for the last one which was really kind of a joke). I have found and implemented a solution]]></description>
			<content:encoded><![CDATA[<p>This always seems to be a sore subject among webmasters, and I have seen some quite silly contrived solutions:</p>
<ul>
<li>addy@DELETE_THISdomain.com</li>
<li>mayemail @ mydomain com</li>
<li>Please contact us for contact information</li>
</ul>
<p>To me, these seem very creative (except for the last one which was really kind of a joke).</p>
<p>I have found and implemented a solution on my server that seems to work very well for eluding this issue. It&#8217;s a little piece of javascript I like to call menc.js.</p>
<p><span id="more-7"></span> Here is a look at the code for the foolwrite function:</p>
<blockquote><p>function foolwrite(a,b,c,d){<br />
var mail;<br />
var linkname;<br />
var link;</p>
<p>mail=a+&#8221;@&#8221;+b+&#8221;.&#8221;+c;<br />
linkname=&#8217;Contact&#8217;<br />
if(d == 0){<br />
document.write(mail);<br />
} else {<br />
link=&#8217;&lt;a href=&#8221;mailto:&#8217;+mail+&#8217;&#8221;&gt;&#8217;+linkname+&#8217;&lt;/a&gt;&#8217;;<br />
document.write(link);<br />
}<br />
}</p></blockquote>
<p>As you can see, the function takes three arguments, which are the address, the domain, and the tld. From there, it builds a mailto link from the three pieces, and returns the link. You can also change the linkname variable to something custom, such as &#8220;webmaster&#8221; or &#8216;&lt;img src=&#8221;path/to/file.jpg&#8221;&gt;&#8217; or something like that. The cool thing is that the source doesn&#8217;t have a scrapable address anymore. <img src='http://www.ozymo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To implement this function, you can either embed it directly, or call it from an external file, as I did, in the same way that you would use any regular javascript. In your code, simply place this line in the place where you would normally put your mailto: link:</p>
<blockquote><p>foolwrite(&#8220;email&#8221;,&#8221;domain&#8221;,&#8221;tld&#8221;);</p></blockquote>
<p>Don&#8217;t forget to enclose it in &lt;script&gt; tags.</p>
<p>And there you have it! This will prevent any screen-scraping-caused-spam that you may be receiving from your sites, and still allow customers to click and send you mail. This means you don&#8217;t have to have any forms that can easily be compromised!</p>
<p>/cs</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ozymo.com/explosions/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
