<?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>Indexed Content &#187; site architecture</title>
	<atom:link href="http://indexedcontent.com/category/site-architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://indexedcontent.com</link>
	<description>SEO Services &#38; Link Building</description>
	<lastBuildDate>Tue, 17 Nov 2009 22:37:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hiding Content from Spiders with jQuery</title>
		<link>http://indexedcontent.com/jquery/hiding-content-from-spiders-jquery/</link>
		<comments>http://indexedcontent.com/jquery/hiding-content-from-spiders-jquery/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 22:43:03 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[site architecture]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://indexedcontent.com/?p=281</guid>
		<description><![CDATA[Any decent SEO is certainly aware of the CSS float technique to manipulate how a search engine spider caches your site.  Unfortunately, for their clients, not many are using client side includes to de-emphasize less desirable content.]]></description>
			<content:encoded><![CDATA[<p>Any decent SEO is certainly aware of the CSS float technique to manipulate how a search engine spider caches your site.  The idea behind this trick is that if the main content of any page is cached before less important, less relevant content, it will slightly improve your keyword rankings.  This SEO technique never really made enough difference for me to get excited about it (maybe that&#8217;s just the link builder in me talking), but below is an example of how it works.</p>
<h4>Floating Divs for SEO</h4>
<pre class="brush: xml;">
&lt;html&gt;
   &lt;head&gt;
      &lt;style&gt;
      #container {width:400;}
      #right {width:200;float:right;}
      #left {width:200;float:left;}
      &lt;/style&gt;
   &lt;/head&gt;
&lt;body&gt;
     &lt;div id=&quot;container&quot;&gt;
          &lt;div id=&quot;right&quot;&gt;
               Content we want to highlight
          &lt;/div&gt;
          &lt;div id=&quot;left&quot;&gt;
               Content we want to bury
          &lt;/div&gt;
     &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h4>JavaScript Templating</h4>
<p>However I recently came across a <a href="http://www.mnot.net/javascript/hinclude/hinclude.js">few</a> <a href="http://www.forgeniuses.com/levi/jsinclude/jquery_sample.htm">javascripts</a> for including files on the client side instead of the traditional server side with php, asp, python etc.  Of course I was familiar with the innerHtml function, but never considered the value of using a JavaScript templating system to prevent undesirable portions of a website from being indexed. This little script (4 lines of code) could, in theory, be an additional site sculpting tool to limit spider-ability much in the same way as the &#8220;nofollow&#8221; tag is used to sculpt PageRank.</p>
<h4>How it Works</h4>
<p>jQuery does the bulk of the heavy lifting and we will borrow Levi Senft&#8217;s <a href="http://www.forgeniuses.com/levi/jsinclude.zip">jsinclude</a> script (or write your own).  Like most JavaScripts, it must be called onload, grabs the file name and path for the file to be included. The content specified between the elements tags is then appended to the dom element in question.  the jsinclude file appends to any div with the class of &#8220;jsinclude&#8221;, but in practice you could set that to whatever naming convention you want.  The content is displayed slightly after the original page is cached by the spider, letting us &#8220;cloak&#8221; our content without fear of reprisal from Google.  We will show the exact same content to a normal visitor and a spider, we will just use the spiders shoddy JavaScript support and inherent need to cache pages quickly against it.  </p>
<h4>How To Implement</h4>
<p>First off the bat we need to download a fresh version of <a href="http://jQuery.com">jQuery</a>, and add it to the HEAD section of your page&#8217;s html, making sure the path points properly.</p>
<pre class="brush: xml;">
&lt;head&gt;
    &lt;script src=&quot;jquery-1.2.6.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
</pre>
<p>Then we want to call the jsinclude file right after our analytics urchin and before the end closing tag.</p>
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot;&gt;
     var pageTracker = _gat._getTracker(&quot;UA-583901-5&quot;);
     pageTracker._trackPageview();
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
      function jsinclude_init() {
	$('div.jsinclude').each(
		function () {
			$('#'+this.id).load(this.innerHTML);
		}
	);
}
&lt;/script&gt;
&lt;/body&gt;
</pre>
<p>Now to apply the proper style to the divs we want to hide, and list the path of the file to include:</p>
<pre class="brush: xml;">

    &lt;div id=&quot;nocache&quot; class=&quot;jsinclude&quot;&gt;/path/to/file.html&lt;/div&gt;
</pre>
<p>That&#8217;s it.  The downside is you have to physically wrap the html-php-etc you want to include in a div, but other than that you now have a JavaScript templating engine that works even on web hosting that doesn&#8217;t support php.</p>
<img src="http://indexedcontent.com/?ak_action=api_record_view&id=281&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://indexedcontent.com/jquery/hiding-content-from-spiders-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
