<?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>Programming Blog &#187; David Walsh Blog</title>
	<atom:link href="http://www.neurosoftware.ro/programming-blog/tag/david-walsh-blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neurosoftware.ro/programming-blog</link>
	<description>Web development , php , ajax , symfony, framework, zend</description>
	<lastBuildDate>Thu, 18 Aug 2011 08:11:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Downloadify:  Client-Side File Generation Using Javascript and&#160;Flash</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/downloadify-client-side-file-generation-using-javascript-andflash/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/downloadify-client-side-file-generation-using-javascript-andflash/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 02:20:51 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[beta stages]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Downloadify]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[flash actionscript code]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[input box]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript users]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[Read]]></category>
		<category><![CDATA[static file]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/downloadify-client-side-file-generation-using-javascript-andflash/</guid>
		<description><![CDATA[The following tools is in its very beta stages and works intermittently. Its so damn useful that I had to show it off now though! I recently stumbled upon Downloadify, a client-side file generation tool based on javascript and Flash ActionScript code. A huge advantage to creating files on the client-side is that you can [...]]]></description>
			<content:encoded><![CDATA[<p><em>The following tools is in its very beta stages and works intermittently.  Its so damn useful that I had to show it off now though!</em></p>
<p>I recently stumbled upon <a href="http://downloadify.info/" rel="nofollow">Downloadify</a>, a client-side file generation tool based on javascript and Flash ActionScript code.  A huge advantage to creating files on the client-side is that you can reduce the load on the server &#8212; especially when there&#8217;s no need for the server to get involved (the data is available within the page, etc.)  Lets take a look at how we can use Downloadify.</p>
<div><a href="http://davidwalsh.name/dw-content/downloadify.php">View Demo</a>
<div></div>
</div>
<h2>Downloadify Usage</h2>
<pre>
Downloadify.create('downloader',{
  filename: function(){
    return 'secret-message.txt'; //static file -- you could retrieve from form input box
  },
  data: function(){
    return 'MooTools FTW!'; //static content -- you could retrieve from form input box
  },
  onComplete: function(){
    alert('The file has been saved!');
  },
  onCancel: function(){
    alert('You have cancelled the saving of this file.');
  },
  onError: function(){
    alert('Error!  Damn!');
  },
  transparent: false,
  swf: 'media/downloadify.swf',
  downloadImage: 'images/download.png',
  width: 210,
  height: 55,
  transparent: true,
  append: false
});
</pre>
<p>Downloadify provides numerous options which you may pass per instance within the create method &#8212; this should look familiar to notice to advanced javascript users.  What I really love about Downloadify is that it provides just the right amount of customization &#8212; events and filename/content settings.  Too many javascript classes/functions try to do too much;  Downloadify gets it right.  My only criticism of Downloadify is it&#8217;s requirement of a 4-state sprite; it would be great if that were an option or the ActionScript could detect the height setting vs. the image file&#8217;s actual height and use the sprite if available.</p>
<h2>MooTools Helper</h2>
<pre>
/* mootools helper */
if(typeof(MooTools) != 'undefined'){
	Element.implement({
		downloadify: function(options) {
			options = $extend(Downloadify.defaultOptions,options);
			return this.store('Downloadify',Downloadify.create(this,options));
		}
	});
}
</pre>
<p>Downloadify comes with a jQuery helper but not a MooTools helper&#8230;I&#8217;ve remedied this.</p>
<div><a href="http://davidwalsh.name/dw-content/downloadify.php">View Demo</a>
<div></div>
</div>
<p>Downloadify fills a need for many developers.  Avoid unnecessary server load and jump on Downloadify!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4386"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/downloadify">Downloadify:  Client-Side File Generation Using Javascript and&nbsp;Flash</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/basic-file-uploading-php" rel="bookmark" title="Permanent Link: Basic File Uploading Using PHP">Basic File Uploading Using&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/facebook-sliders-with-mootools-and-css-now-with-image-generation" rel="bookmark" title="Permanent Link: Facebook Sliders With Mootools and CSS – Now With Image Generation!">Facebook Sliders With Mootools and CSS &#8211; Now With Image&nbsp;Generation!</a></li>
<li><a href="http://davidwalsh.name/create-zip-php" rel="bookmark" title="Permanent Link: Create a Zip File Using PHP">Create a Zip File Using&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/basic-php-file-handling-create-open-read-write-append-close-delete" rel="bookmark" title="Permanent Link: Basic PHP File Handling — Create, Open, Read, Write, Append, Close, and Delete">Basic PHP File Handling &#8212; Create, Open, Read, Write, Append, Close, and&nbsp;Delete</a></li>
<li><a href="http://davidwalsh.name/wordpress-htaccess-file-is-genius" rel="bookmark" title="Permanent Link: WordPress’ .htaccess File Is Genius">WordPress&#8217; .htaccess File Is&nbsp;Genius</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/b2984_HdtUpGTc4S0" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/downloadify-client-side-file-generation-using-javascript-andflash/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>NetTuts:  Sexy Animated Tabs Using&#160;MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/nettuts-sexy-animated-tabs-usingmootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/nettuts-sexy-animated-tabs-usingmootools/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:21:11 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[css sprites]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[little space]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[Nettuts]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Tab]]></category>
		<category><![CDATA[tab system]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/nettuts-sexy-animated-tabs-usingmootools/</guid>
		<description><![CDATA[I&#8217;ve just released my third NetTuts post:  http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/ .  From the post: One modern, attractive way of placing a lot of content into a little space is by using a tab system. This tutorial will show you how to create a sexy, animated tab system complete with CSS sprites, cookies, and animated tab swapping. Go [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/"><img src="http://davidwalsh.name/dw-content/nettuts-tabs-img.jpg" alt="MooTools Tabs" class="image" /></a></p>
<p>I&#8217;ve just released my third NetTuts post:  <a href="http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/" rel="nofollow">http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/</a> .  From the post:</p>
<blockquote><p>One modern, attractive way of placing a lot of content into a little space is by using a tab system. This tutorial will show you how to create a sexy, animated tab system complete with CSS sprites, cookies, and animated tab swapping.</p></blockquote>
<p>Go over to NetTuts and check it out!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4636"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/nettuts-animated-tabs">NetTuts:  Sexy Animated Tabs Using&nbsp;MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/load-more-widget" rel="bookmark" title="Permanent Link: David Walsh on NetTuts:  Create a Twitter-Like “Load More” Widget">David Walsh on NetTuts:  Create a Twitter-Like “Load More”&nbsp;Widget</a></li>
<li><a href="http://davidwalsh.name/twitter-emulation-mootools-php" rel="bookmark" title="Permanent Link: NetTuts Exclusive:  Twitter Emulation Using MooTools 1.2 and PHP">NetTuts Exclusive:  Twitter Emulation Using MooTools 1.2 and&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/progress-bar-animated-mootools" rel="bookmark" title="Permanent Link: Animated Progress Bars Using MooTools: dwProgressBar">Animated Progress Bars Using MooTools:&nbsp;dwProgressBar</a></li>
<li><a href="http://davidwalsh.name/eight7teen-interview" rel="bookmark" title="Permanent Link: Eight7Teen Interview">Eight7Teen&nbsp;Interview</a></li>
<li><a href="http://davidwalsh.name/animate-opacity" rel="bookmark" title="Permanent Link: Sexy Opacity Animation with MooTools or jQuery">Sexy Opacity Animation with MooTools or&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/85e57_qHhAAOFdICY" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/nettuts-sexy-animated-tabs-usingmootools/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Function:  Remove a Query String&#160;Key=&gt;Value</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/php-function-remove-a-query-stringkeyvalue/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/php-function-remove-a-query-stringkeyvalue/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 02:31:03 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[duplicate keys]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[gt value]]></category>
		<category><![CDATA[microsoft sql server]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php query string]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[string variables]]></category>
		<category><![CDATA[URI]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/php-function-remove-a-query-stringkeyvalue/</guid>
		<description><![CDATA[I was recently coding a website which relied heavily on query string variables. It was absolutely imperative that I keep the query string clean and not duplicate keys. I needed to find a PHP function that would allow me to remove keys (and their values) easily and reliably. Enter a PHP function I found at [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently coding a website which relied heavily on query string variables.  It was absolutely imperative that I keep the query string clean and not duplicate keys.  I needed to find a PHP function that would allow me to remove keys (and their values) easily and reliably.  Enter a PHP function I found at <a href="http://www.addedbytes.com/code/querystring-functions/" rel="nofollow">Added Bytes</a>:</p>
<pre>
/* the function */
function remove_querystring_var($url, $key) {
	$url = preg_replace('/(.*)(?|&amp;)' . $key . '=[^&amp;]+?(&amp;)(.*)/i', '$1$2$4', $url . '&amp;');
	$url = substr($url, 0, -1);
	return $url;
}

/* usage */
//pretending this page is
</pre>
<p>All I needed to do was provide the URL (in my case I wanted the current page&#8217;s URI) and the key to remove &#8212; so simple!</p>
<p>All credit goes to Added Bytes for their awesome work.  It saved me a lot of time&#8230;hopefully it does for you too!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4626"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/php-remove-variable">PHP Function:  Remove a Query String&nbsp;Key=&gt;Value</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/change-php-query-string-variable-separator-php-ini" rel="bookmark" title="Permanent Link: Change the PHP Query String Variable Separator Using php.ini">Change the PHP Query String Variable Separator Using&nbsp;php.ini</a></li>
<li><a href="http://davidwalsh.name/php-function-get-file-extension-string" rel="bookmark" title="Permanent Link: PHP Function To Get A File Extension From A String">PHP Function To Get A File Extension From A&nbsp;String</a></li>
<li><a href="http://davidwalsh.name/generate-readable-byte-labels-using-php" rel="bookmark" title="Permanent Link: Generate Readable Byte Labels Using PHP">Generate Readable Byte Labels Using&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/php-microsoft-sql-server-mssql-iis-connect-query-odbc" rel="bookmark" title="Permanent Link: PHP, Microsoft SQL Server (MSSQL), and IIS:  Connect and Query with ODBC">PHP, Microsoft SQL Server (MSSQL), and IIS:  Connect and Query with&nbsp;ODBC</a></li>
<li><a href="http://davidwalsh.name/remove-broken-images" rel="bookmark" title="Permanent Link: Remove Broken Images Using MooTools or jQuery">Remove Broken Images Using MooTools or&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/598b7_ZF7rvvxG52s" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/php-function-remove-a-query-stringkeyvalue/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>IE Conditional&#160;Comments</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ie-conditionalcomments/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ie-conditionalcomments/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 14:16:24 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[argument]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Explorer]]></category>
		<category><![CDATA[functionality issues]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[javascript issues]]></category>
		<category><![CDATA[js library]]></category>
		<category><![CDATA[Major Roadblocks]]></category>
		<category><![CDATA[operator]]></category>
		<category><![CDATA[operator returns]]></category>
		<category><![CDATA[png support]]></category>
		<category><![CDATA[quot]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ie-conditionalcomments/</guid>
		<description><![CDATA[As we all know too well, Internet Explorer is the browser that tends to cause web developers the most pain. Maybe it&#8217;s because Microsoft currently has 3 very different browser versions we have to account for. Maybe it&#8217;s because the earlier versions of the browsers didn&#8217;t adhere to standards. Maybe it&#8217;s because IE6 wasn&#8217;t updated [...]]]></description>
			<content:encoded><![CDATA[<p>As we all know too well, Internet Explorer is the browser that tends to cause web developers the most pain.  Maybe it&#8217;s because Microsoft currently has 3 very different browser versions we have to account for.  Maybe it&#8217;s because the earlier versions of the browsers didn&#8217;t adhere to standards.  Maybe it&#8217;s because IE6 wasn&#8217;t updated for so many years.  Whatever the reason, IE is here and we have to deal with it.</p>
<p>CSS and Javascript issues within each version of IE present us with layout and functionality issues.  Double margins, floating and absolute positioning, and lack of PNG support are probably the most frequent problems.  Luckily Internet Explorer has been supporting conditional comments which allow us to target blocks of HTML toward all IE browsers or specified IE browsers.</p>
<h2>Examples of IE Conditional Comments</h2>
<pre>
&lt;!--[if IE]&gt;
&lt;style type=&quot;text/css&quot;&gt;
a		{ color:#fff; }
&lt;/style&gt;
&lt;![endif]--&gt;
</pre>
<p>The example above sets the color of links to red if the browser is any flavor of Internet Explorer.</p>
<pre>
&lt;!--[if lt IE 8]&gt;
&lt;script src=&quot;http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
</pre>
<p>The example above example includes the IE8.js library int the page if the version of Internet Explorer is less than 8.</p>
<pre>
&lt;!--[if IE 6]&gt;
&lt;script src=&quot;DD_belatedPNG.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
  DD_belatedPNG.fix('.png');
&lt;/script&gt;
&lt;![endif]--&gt;
</pre>
<p>The example above fixes PNGs if the browser is Internet Explorer 6.</p>
<h2>Conditional Comments Syntax Table</h2>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<th>Item</th>
<th>Example</th>
<th>Comment</th>
</tr>
<tr>
<td>!</td>
<td>[if !IE]</td>
<td>The NOT operator. This is placed immediately in front of the <em>feature</em>, <em>operator</em>, or <em>subexpression</em> to reverse the Boolean meaning of the expression.</td>
</tr>
<tr>
<td>lt</td>
<td>[if lt IE 5.5]</td>
<td>The less-than operator. Returns true if the first argument is less than the second argument.</td>
</tr>
<tr>
<td>lte</td>
<td>[if lte IE 6]</td>
<td>The less-than or equal operator. Returns true if the first argument is less than or equal to the second argument.</td>
</tr>
<tr>
<td>gt</td>
<td>[if gt IE 5]</td>
<td>The greater-than operator. Returns true if the first argument is greater than the second argument.</td>
</tr>
<tr>
<td>gte</td>
<td>[if gte IE 7]</td>
<td>The greater-than or equal operator. Returns true if the first argument is greater than or equal to the second argument.</td>
</tr>
<tr>
<td>( )</td>
<td>[if !(IE 7)]</td>
<td>Subexpression operators. Used in conjunction with boolean operators to create more complex expressions. </td>
</tr>
<tr>
<td>&amp;</td>
<td>[if (gt IE 5)&amp;(lt IE 7)]</td>
<td>The AND operator. Returns true if all subexpressions evaluate to true</td>
</tr>
<tr>
<td>|</td>
<td>[if (IE 6)|(IE 7)]</td>
<td>The OR operator. Returns true if any of the subexpressions evaluates to true.</td>
</tr>
</table>
<p>While we all dislike Internet Explorer&#8217;s bugs, their conditional comment syntax provides us a perfect method for fixing them quickly.</p>
<h2>Valuable Resources</h2>
<ul>
<li>If you&#8217;d like to cut one of the browser version issues out of the equation, you can always <a href="http://davidwalsh.name/ie8-emulate-ie7">make IE8 emulate IE7</a>.</li>
<li>Be sure to check out the <a href="http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx" rel="nofollow">MSDN documentation</a> for Microsoft&#8217;s &#8220;official&#8221; guide.</li>
<li><a href="http://www.quirksmode.org/css/condcom.html" rel="nofollow">PPK</a> has some awesome notes about conditional comments.</li>
</ul>
<p>Have fun fixing your code in Internet Explorer with conditional comments!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4585"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/ie-conditional-comments">IE Conditional&nbsp;Comments</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/microsofts-internet-atrocities" rel="bookmark" title="Permanent Link: Microsoft’s Internet Atrocities">Microsoft&#8217;s Internet&nbsp;Atrocities</a></li>
<li><a href="http://davidwalsh.name/the-7-major-roadblocks-that-cripple-web-developers-and-the-internet" rel="bookmark" title="Permanent Link: The 7 Major Roadblocks That Cripple Web Developers and The Internet">The 7 Major Roadblocks That Cripple Web Developers and The&nbsp;Internet</a></li>
<li><a href="http://davidwalsh.name/mootools-add-event" rel="bookmark" title="Permanent Link: Adding Events to Adding Events in MooTools">Adding Events to Adding Events in&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/web-predictions-2009" rel="bookmark" title="Permanent Link: Web Predictions For 2009">Web Predictions For&nbsp;2009</a></li>
<li><a href="http://davidwalsh.name/april-fools-change-php-pages-asp" rel="bookmark" title="Permanent Link: April Fools!  Change Your PHP Pages to ASP…Or Not">April Fools!  Change Your PHP Pages to ASP&#8230;Or&nbsp;Not</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/934aa_IDMs3Z7p9DE" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ie-conditionalcomments/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Test For Popup Blocker Using&#160;Javascript</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/test-for-popup-blocker-usingjavascript/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/test-for-popup-blocker-usingjavascript/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 02:33:34 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[blocker]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript close]]></category>
		<category><![CDATA[javascript print]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/test-for-popup-blocker-usingjavascript/</guid>
		<description><![CDATA[Several websites rely on the ever-so-annoying popup window. As much as well all hate popup windows, some websites do benefit and justly require them. The problem is that some people have their popup blocker on but don&#8217;t know it &#8212; thus the new window doesn&#8217;t open. Of course the browser notifies the user but it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/59f26_popups.jpg" alt="Popup Window" class="image" /></p>
<p>Several websites rely on the ever-so-annoying popup window.  As much as well all hate popup windows, some websites do benefit and justly require them.  The problem is that some people have their popup blocker on but don&#8217;t know it &#8212; thus the new window doesn&#8217;t open.  Of course the browser notifies the user but it isn&#8217;t always as obvious as it should be.  Here&#8217;s a quick method for testing if your popup window is being blocked.</p>
<h2>The Javascript</h2>
<pre>
var windowName = 'userConsole';
var popUp = window.open('/popup-page.php', windowName, 'width=1000, height=700, left=24, top=24, scrollbars, resizable');
if (popUp == null || typeof(popUp)=='undefined') {
	alert('Please disable your pop-up blocker and click the "Open" link again.');
}
else {
	popUp.focus();
}
</pre>
<p>The first step is to give the directive to open a new window, saving what&#8217;s returned.  Then we check to see if the object exists.  If it does, we&#8217;re good.  If it doesn&#8217;t, we give an alert to the user that their popup blocker may be on.  The specific text warning can be set to whatever you&#8217;d like, as could the method of giving them the message.  You could also use a <a href="http://davidwalsh.name/toggle-slider-mootools">sexy MooTools slider</a> to show the message.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4608"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/popup-block-javascript">Test For Popup Blocker Using&nbsp;Javascript</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/nsfw-blocker-mootools-css" rel="bookmark" title="Permanent Link: NSFW Blocker Using MooTools and CSS">NSFW Blocker Using MooTools and&nbsp;CSS</a></li>
<li><a href="http://davidwalsh.name/create-javascript-close-link" rel="bookmark" title="Permanent Link: How To Create A Javascript Close Link">How To Create A Javascript Close&nbsp;Link</a></li>
<li><a href="http://davidwalsh.name/firebug-console-log" rel="bookmark" title="Permanent Link: Logging Information to the Firebug Javascript Console">Logging Information to the Firebug Javascript&nbsp;Console</a></li>
<li><a href="http://davidwalsh.name/create-javascript-print-link" rel="bookmark" title="Permanent Link: How To Create A Javascript Print Link">How To Create A Javascript Print&nbsp;Link</a></li>
<li><a href="http://davidwalsh.name/javascript-unique-letters-string" rel="bookmark" title="Permanent Link: Javascript Exercise: Find the Number of Unique Letters in a String">Javascript Exercise: Find the Number of Unique Letters in a&nbsp;String</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/59f26_4wUg_RWY7Ws" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/test-for-popup-blocker-usingjavascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hot Effect: MooTools Drag&#160;Opacity</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/hot-effect-mootools-dragopacity/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/hot-effect-mootools-dragopacity/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 02:27:45 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[default image]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[drag]]></category>
		<category><![CDATA[drop elements]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[Opacity]]></category>
		<category><![CDATA[visual features]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/hot-effect-mootools-dragopacity/</guid>
		<description><![CDATA[As you should already know, the best visual features of a website are usually held within the most subtle of details. One simple trick that usually makes a big different is the use of opacity and fading. Another awesome MooTools functionality is dragging. Why not double the awesomeness of Element dragging by adding fading? View [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwalsh.name/dw-content/drag-opacity.php"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/0cb6f_drag-opacity.jpg" alt="MooTools Drag Opacity" class="image" /></a></p>
<p>As you should already know, the best visual features of a website are usually held within the most subtle of details.  One simple trick that usually makes a big different is the use of opacity and fading.  Another awesome MooTools functionality is dragging.  Why not double the awesomeness of Element dragging by adding fading?</p>
<div><a href="http://davidwalsh.name/dw-content/drag-opacity.php">View Demo</a>
<div></div>
</div>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function() {
	var z = 2;
	$$('.draggable').each(function(el) {
		var drag = new Drag.Move(el,{
			grid: false,
			preventDefault: true,
			onStart: function() {
				el.setStyle('z-index',z++).fade(0.5);
			},
			onComplete: function() {
				el.fade(1);
			}
		});
	});
});
</pre>
<p>The code itself is quite simple &#8212; we use Drag.Move&#8217;s onStart and onComplete events to begin and end the fading.  We&#8217;ve chosen to fade to the desired opacity level over a given duration because a subtle fade is a bit less drastic.  We could simply use set(&#8216;opacity&#8217;,&#8217;0.5&#8242;) if we wanted an immediate fade.</p>
<div><a href="http://davidwalsh.name/dw-content/drag-opacity.php">View Demo</a>
<div></div>
</div>
<p>I consider the above effect a &#8220;cheap&#8221; way to increase the coolness of element dragging.  Very little overhead and just another effect to take your website to the next level!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4568"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-drag-opacity">Hot Effect: MooTools Drag&nbsp;Opacity</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/drag-drop-elements-trash-mootools" rel="bookmark" title="Permanent Link: Drag &amp; Drop Elements to the Trash with MooTools 1.2">Drag &#38; Drop Elements to the Trash with MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/mootools-drag-drop" rel="bookmark" title="Permanent Link: Using MooTools 1.2 For Drag, Drop, Sort, Save">Using MooTools 1.2 For Drag, Drop, Sort,&nbsp;Save</a></li>
<li><a href="http://davidwalsh.name/opacity-focus" rel="bookmark" title="Permanent Link: Using Opacity to Show Focus with MooTools">Using Opacity to Show Focus with&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/mootools-pulsefade-plugin" rel="bookmark" title="Permanent Link: MooTools PulseFade Plugin">MooTools PulseFade&nbsp;Plugin</a></li>
<li><a href="http://davidwalsh.name/prevent-internet-explorers-default-image-dragging-action" rel="bookmark" title="Permanent Link: Prevent Internet Explorer’s Default Image Dragging Action">Prevent Internet Explorer&#8217;s Default Image Dragging&nbsp;Action</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/0cb6f_yXzmUOTc8sU" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/hot-effect-mootools-dragopacity/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MooTools Quick Coding:  Expand&#160;Abbreviation</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-quick-coding-expandabbreviation/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-quick-coding-expandabbreviation/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:23:38 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[element blocks]]></category>
		<category><![CDATA[expanAbbr]]></category>
		<category><![CDATA[footer text]]></category>
		<category><![CDATA[header document]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[target attributes]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[ul element]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-quick-coding-expandabbreviation/</guid>
		<description><![CDATA[One of the many great reasons for an official MooTools Forge is that I get to check one place to find numerous MooTools plugins that I&#8217;ve never seen before. One such plugin, Expand Abbreviation, allows the developer to create elements using ZEN-Coding methodology. Instead of coding numerous new Element blocks, Expand Abbreviation generates elements for [...]]]></description>
			<content:encoded><![CDATA[<p>One of the many great reasons for an official <a href="http://mootools.net/plugins" rel="nofollow">MooTools Forge</a> is that I get to check one place to find numerous MooTools plugins that I&#8217;ve never seen before.  One such plugin, <a href="http://mootools.net/forge/p/expand_abbreviation" rel="nofollow">Expand Abbreviation</a>, allows the developer to create elements using ZEN-Coding methodology.  Instead of coding numerous new Element blocks, Expand Abbreviation generates elements for you based on a string syntax.</p>
<h2>Sample Usage</h2>
<pre>
window.addEvent('domready', function() {
	// Generating Header
	document.body.expanAbbr( 'div#header&gt;div#logo^text=Containing Logo+div#navigation+div#subnavigation' );

	// the Navigation with some li's and a's
	$('navigation').expanAbbr( 'ul&gt;li*3&gt;a^href=http://www.google.com,text=GOOGLE,target=_blank,title=a navigation link' );

	// the Navigation with some li's and a's
	$('subnavigation').expanAbbr( 'ul&gt;li*5&gt;a^href=http://www.nyt.com,text=NYT,title=a link' );

	// Generating Main Content Body with left and right column
	document.body.expanAbbr( 'div#main&gt;div#content' );
	$('content').expanAbbr( 'div.box*24&gt;h3^text=a little box+p^text=with some content' );
	$('content').expanAbbr( 'br^style=clear:both' );

	// Generating Footer and Sitemap Body
	document.body.expanAbbr( 'div#bottom&gt;div#sitemap^text=The Sitemap+div#footer^text=The Footer' );
});
</pre>
<p>There&#8217;s a lot there so lets take one and talk through what it does.</p>
<pre>
$('navigation').expanAbbr( 'ul&gt;li*3&gt;a^href=http://www.google.com,text=GOOGLE,target=_blank,title=a navigation link' );
</pre>
<p>The above code:</p>
<ul>
<li>Creates a UL element within the &#8220;navigation&#8221; element.</li>
<li>Creates 3 list items within the UL</li>
<li>Creates an A element within each link with assigned text and HREF and TARGET attributes.</li>
</ul>
<p>Once the elements are in place, you can modify them as you could any other element.  While this plugin likely wont be used by the majority of MooTools developers, it&#8217;s a great option for those who want create elements quickly and with minimal code.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4548"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-expand-abbreviation">MooTools Quick Coding:  Expand&nbsp;Abbreviation</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/css-enhancements-user-experience" rel="bookmark" title="Permanent Link: 7 Quick CSS Enhancements for Better User Experience">7 Quick CSS Enhancements for Better User&nbsp;Experience</a></li>
<li><a href="http://davidwalsh.name/text-select-widget" rel="bookmark" title="Permanent Link: New York Times-Style Text Selection Widget Using MooTools or jQuery">New York Times-Style Text Selection Widget Using MooTools or&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/assign-anchor-ids-php" rel="bookmark" title="Permanent Link: Assign Anchor IDs Using PHP">Assign Anchor IDs Using&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/event-delegation" rel="bookmark" title="Permanent Link: Event Delegation with MooTools">Event Delegation with&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/glitter-navigation-mootools-javascript" rel="bookmark" title="Permanent Link: Fancy Navigation with MooTools Javascript">Fancy Navigation with MooTools&nbsp;Javascript</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/fca04_lrEUOi86tqc" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-quick-coding-expandabbreviation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Really Useful Tutorials You Should Have Read in December 2009</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/really-useful-tutorials-you-should-have-read-in-december-2009/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/really-useful-tutorials-you-should-have-read-in-december-2009/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 21:08:47 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[featured publications]]></category>
		<category><![CDATA[globe]]></category>
		<category><![CDATA[M Garage]]></category>
		<category><![CDATA[Perishable]]></category>
		<category><![CDATA[press]]></category>
		<category><![CDATA[Publications]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/really-useful-tutorials-you-should-have-read-in-december-2009/</guid>
		<description><![CDATA[Featured Publications/Blogs include: Perishable Press, Arbenting Freebies, Marcofolio, Woork, Onextrapixel, Nettuts+, CSS Globe, 24 Ways, Smashing Magazine, AEXT, Noupe, Tutorialzine, Viget Inspire, Queness, David Walsh Blog, Position Absolute, CreativeFan, PV.M Garage and more. Go to Source]]></description>
			<content:encoded><![CDATA[<p>Featured Publications/Blogs include: Perishable Press, Arbenting Freebies, Marcofolio, Woork, Onextrapixel, Nettuts+, CSS Globe, 24 Ways, Smashing Magazine, AEXT, Noupe, Tutorialzine, Viget Inspire, Queness, David Walsh Blog, Position Absolute, CreativeFan, PV.M Garage and more.</p>
<p><a href="http://feeds2.feedburner.com/Devsnippets">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/really-useful-tutorials-you-should-have-read-in-december-2009/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using the GitHub API and PHP to Get Repository&#160;Information</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-the-github-api-and-php-to-get-repositoryinformation/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-the-github-api-and-php-to-get-repositoryinformation/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 17:05:03 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[Markdown]]></category>
		<category><![CDATA[Michel Fortin]]></category>
		<category><![CDATA[open source project]]></category>
		<category><![CDATA[path server]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server document]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-the-github-api-and-php-to-get-repositoryinformation/</guid>
		<description><![CDATA[GitHub is an awesome place to host your open source project code. MooTools, Prototype, and jQuery all use GitHub. As you probably know, the MooTools Forge requires your plugins be hosted on GitHub. The only problem with hosting all my MooTools plugins is that I lose traffic when I want people to see my code. [...]]]></description>
			<content:encoded><![CDATA[<p>GitHub is an awesome place to host your open source project code.  MooTools, Prototype, and jQuery all use GitHub.  As you probably know, the MooTools Forge requires your plugins be hosted on GitHub.  The only problem with hosting all my MooTools plugins is that I lose traffic when I want people to see my code.   Problem solved:  use PHP, the GitHub API, and PHP Markdown to display files of my choice on my website.</p>
<p>Our goals with this code will be to:</p>
<ul>
<li>Connect to GitHub via the API to retrieve repository information.</li>
<li>Retrieve the content of two files from the repository:  a source file and the README.md Markdown file.</li>
<li>Cache the information for a given period of time to reduce the load on GitHub.</li>
<li>Use PHP Markdown to output a formatted README.md file.</li>
</ul>
<p>I know that seems like a lot of work but you&#8217;ll be amazed at how easy the process is.</p>
<h2>PHP MarkDown</h2>
<p>You may download PHP Markdown at <a href="http://michelf.com/projects/php-markdown/">Michel Fortin&#8217;s website</a>.  It&#8217;s simple and full of features.</p>
<h2>The PHP</h2>
<p>The first step is to build a PHP function that will connect to GitHub using cURL:</p>
<pre>
/* gets url */
function get_content_from_github($url) {
	$ch = curl_init();
	curl_setopt($ch,CURLOPT_URL,$url);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1);
	$content = curl_exec($ch);
	curl_close($ch);
	return $content;
}
</pre>
<p>Next we need to define a few settings:</p>
<pre>
/* static settings */
$plugin = 'Overlay';
$cache_path = $_SERVER['DOCUMENT_ROOT'].'/plugin-cache/';
$cache_file = $plugin.'-github.txt';
$github_json = get_repo_json($cache_path.$cache_file,$plugin);
</pre>
<p>The next step is to create another PHP function that grabs the repository information (JSON-encoded, because I love JSON) &#8212; either fresh from GitHub (by first grabbing the most recent commit hash, then grabbing the contents of the two files) or our local cached information:</p>
<pre>
/* gets the contents of a file if it exists, otherwise grabs and caches */
function get_repo_json($file,$plugin) {
	//vars
	$current_time = time(); $expire_time = 24 * 60 * 60; $file_time = filemtime($file);
	//decisions, decisions
	if(file_exists($file) &#38;&#38; ($current_time - $expire_time &lt; $file_time)) {
		//echo &#039;returning from cached file&#039;;
		return json_decode(file_get_contents($file));
	}
	else {
		$json = array();
		$json[&#039;repo&#039;] = json_decode(get_content_from_github(&#039;http://github.com/api/v2/json/repos/show/darkwing/&#039;.$plugin),true);
		$json[&#039;commit&#039;] = json_decode(get_content_from_github(&#039;http://github.com/api/v2/json/commits/list/darkwing/&#039;.$plugin.&#039;/master&#039;),true);
		$json[&#039;readme&#039;] = json_decode(get_content_from_github(&#039;http://github.com/api/v2/json/blob/show/darkwing/&#039;.$plugin.&#039;/&#039;.$json[&#039;commit&#039;][&#039;commits&#039;][0][&#039;parents&#039;][0][&#039;id&#039;].&#039;/Docs/&#039;.$plugin.&#039;.md&#039;),true);
		$json[&#039;js&#039;] = json_decode(get_content_from_github(&#039;http://github.com/api/v2/json/blob/show/darkwing/&#039;.$plugin.&#039;/&#039;.$json[&#039;commit&#039;][&#039;commits&#039;][0][&#039;parents&#039;][0][&#039;id&#039;].&#039;/Source/&#039;.$plugin.&#039;.js&#039;),true);
		file_put_contents($file,json_encode($json));
		return $content;
	}
}
</pre>
<p>Once we&#8217;ve acquired the appropriate information, we output the information to screen:</p>
<pre>
/* build json */
if($github_json) {

	//get markdown
	include($_SERVER['DOCUMENT_ROOT'].'/wp-content/themes/walshbook3/PHP-Markdown-Extra-1.2.4/markdown.php');

	//build content
	$content = '

'.$github_json['repo']['repository']['description'].'

';
	$content.= '
<h2>MooTools Javascript Class</h2>
<pre>'.$github_json['js']['blob']['data'].'</pre>
<p>';<br />
	$content.= trim(str_replace(array('<code>','</code>'),'',Markdown($github_json['readme']['blob']['data'])));<br />
}
</pre>
<p>That&#8217;s all!  Now I get the benefit of hosting my code on GitHub but displaying it on my own website.  I&#8217;ve created a special WordPress template page to do so and recommend you do too!</p>
<h2>Demo?</h2>
<p>Visit my <a href="http://davidwalsh.name/js/">Projects page</a> and click on the &#8220;Docs&#8221; link for any project.  All of the information that comes up on individual project pages comes from GitHub.  No more manual page creation!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4526"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/github-markdown">Using the GitHub API and PHP to Get Repository&nbsp;Information</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-plugins" rel="bookmark" title="Permanent Link: Forge:  MooTools Plugin Repository">Forge:  MooTools Plugin&nbsp;Repository</a></li>
<li><a href="http://davidwalsh.name/mootools-forge-script" rel="bookmark" title="Permanent Link: MooTools Forge / GitHub Plugin Structure Shell Script">MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></li>
<li><a href="http://davidwalsh.name/github-badge" rel="bookmark" title="Permanent Link: Represent Your Repositories Using the GitHub Badge!">Represent Your Repositories Using the GitHub&nbsp;Badge!</a></li>
<li><a href="http://davidwalsh.name/github-merge-batch" rel="bookmark" title="Permanent Link: Create a GitHub Merge Batch File">Create a GitHub Merge Batch&nbsp;File</a></li>
<li><a href="http://davidwalsh.name/mootools-github" rel="bookmark" title="Permanent Link: Follow MooTools on GitHub!">Follow MooTools on&nbsp;GitHub!</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/a4084_bS_-CdB31GA" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-the-github-api-and-php-to-get-repositoryinformation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MooTools Tip:&#160;Event.stop</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-tipevent-stop/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-tipevent-stop/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 15:50:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[default event]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[myLink]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[rare occasion]]></category>
		<category><![CDATA[safe way]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-tipevent-stop/</guid>
		<description><![CDATA[Events are a huge part of javascript because so much of our javascript is triggered by the user&#8217;s actions. Quite frequently we will assign a listener to a link and immediately want the default click action stopped. For example: $('myLink').addEvent('click',function(e) { e.stop(); //do stuff }); The above code works great but there&#8217;s one small hole [...]]]></description>
			<content:encoded><![CDATA[<p>Events are a huge part of javascript because so much of our javascript is triggered by the user&#8217;s actions.  Quite frequently we will assign a listener to a link and immediately want the default click action stopped.  For example:</p>
<pre>
$('myLink').addEvent('click',function(e) {
	e.stop();
	//do stuff
});
</pre>
<p>The above code works great but there&#8217;s one small hole I sometimes run into.  On rare occasion I feel the need to trigger an event on an element:</p>
<pre>
$('myLink').fireEvent('click');
</pre>
<p>The problem is that the Event object is not given when an event is triggered using <span>Element.fireEvent</span>.  The way to prevent any problems is an easy if check:</p>
<pre>
$('myLink').addEvent('click',function(e) {
	if(e) e.stop();
	//do stuff
});
</pre>
<p>Voila.  The safe way to stop events!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4518"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-event-stop">MooTools Tip:&nbsp;Event.stop</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/prevent-default-event-actions-mootools-12" rel="bookmark" title="Permanent Link: Prevent Default Event Actions Using MooTools 1.2">Prevent Default Event Actions Using MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/event-delegation" rel="bookmark" title="Permanent Link: Event Delegation with MooTools">Event Delegation with&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/implement-jquery-mootools-event" rel="bookmark" title="Permanent Link: Implementing jQuery-Like Event Syntax in MooTools">Implementing jQuery-Like Event Syntax in&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/mootools-event-delegation" rel="bookmark" title="Permanent Link: MooTools Event Delegation">MooTools Event&nbsp;Delegation</a></li>
<li><a href="http://davidwalsh.name/jquery-add-event" rel="bookmark" title="Permanent Link: Implement MooTools’ Elements.addEvent in jQuery">Implement MooTools&#8217; Elements.addEvent in&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/4a897_XOQj9ujwTIQ" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-tipevent-stop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Create a Simple Slideshow Using&#160;MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-simple-slideshow-usingmootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-simple-slideshow-usingmootools/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 17:05:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[absolute position]]></category>
		<category><![CDATA[Christina Ricci]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[div id]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[img src]]></category>
		<category><![CDATA[lt images]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[var]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-simple-slideshow-usingmootools/</guid>
		<description><![CDATA[One excellent way to add dynamism to any website is to implement a slideshow featuring images or sliding content. Of course there are numerous slideshow plugins available but many of them can be overkill if you want to do simple slideshow without controls or events. We&#8217;re going to create a simple slideshow from which we&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/88aa1_cricci1.jpg" alt="Christina Ricci" width="512" height="384" /></p>
<p>One excellent way to add dynamism to any website is to implement a slideshow featuring images or sliding content.  Of course there are numerous slideshow plugins available but many of them can be overkill if you want to do simple slideshow without controls or events.  We&#8217;re going to create a simple slideshow from which we&#8217;ll build on.</p>
<div><a href="http://davidwalsh.name/dw-content/simple-slideshow.php">View Demo</a>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
&lt;div id="slideshow-container"&gt;
	&lt;img src="slideshow/cricci1.jpg" alt="Christina Ricci" /&gt;
	&lt;img src="slideshow/cricci2.jpg" alt="Christina Ricci" /&gt;
	&lt;img src="slideshow/cricci3.jpg" alt="Christina Ricci" /&gt;
	&lt;img src="slideshow/cricci4.jpg" alt="Christina Ricci" /&gt;
	&lt;img src="slideshow/cricci5.jpg" alt="Christina Ricci" /&gt;
&lt;/div&gt;
</pre>
<p>The HTML is as simple as it can be &#8212; one slideshow container <span>DIV</span> and the images that will be part of the show.  This slideshow doesn&#8217;t require that you use images &#8212; you could just as easily use <span>DIVs</span> instead.</p>
<h2>The CSS</h2>
<pre>
#slideshow-container	{ width:512px; height:384px; position:relative; }
#slideshow-container img { display:block; position:absolute; top:0; left:0; z-index:1; }
</pre>
<p>It&#8217;s important that the slideshow container receive a set height and width as well as its <span>position</span> set to <span>relative</span>.  Slideshow items must have an absolute position with <span>top</span> and <span>left</span> set to 0.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function() {
	/* settings */
	var showDuration = 3000;
	var container = $('slideshow-container');
	var images = container.getElements('img');
	var currentIndex = 0;
	var interval;
	/* opacity and fade */
	images.each(function(img,i){
		if(i &gt; 0) {
			img.set('opacity',0);
		}
	});
	/* worker */
	var show = function() {
		images[currentIndex].fade('out');
		images[currentIndex = currentIndex &lt; images.length - 1 ? currentIndex+1 : 0].fade('in');
	};
	/* start once the page is finished loading */
	window.addEvent('load',function(){
		interval = show.periodical(showDuration);
	});
});
</pre>
<p>The first step in the slideshow creation process is to define the show duration, grab the container and slideshow items, etc.  Then we cycle through each image/slide to set its opacity to 0 if it&#8217;s not in the first position.  Next we create the function that fades out the current image and fades in the next image.  The last step is directing the slideshow to start when the page has completed loading.  Simple!</p>
<div><a href="http://davidwalsh.name/dw-content/simple-slideshow.php">View Demo</a>
<div></div>
</div>
<h2>More to Come</h2>
<p>This post will be the first of many with regard to improving upon this simple slideshow.  In future posts, we&#8217;ll be adding start/stop/pause controls, table of contents, and making this simple slideshow a MooTools class with loads of options.  In the mean time, enjoy this simple slideshow!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4373"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-slideshow">Create a Simple Slideshow Using&nbsp;MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-image-preloading-progress-bar" rel="bookmark" title="Permanent Link: MooTools Image Preloading with Progress Bar">MooTools Image Preloading with Progress&nbsp;Bar</a></li>
<li><a href="http://davidwalsh.name/javascrip-reflection" rel="bookmark" title="Permanent Link: Image Reflection with jQuery and MooTools">Image Reflection with jQuery and&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/moousture" rel="bookmark" title="Permanent Link: Create a Download Package Using MooTools Moousture">Create a Download Package Using MooTools&nbsp;Moousture</a></li>
<li><a href="http://davidwalsh.name/simple-mootools-accordion" rel="bookmark" title="Permanent Link: Build a Slick and Simple MooTools Accordion">Build a Slick and Simple MooTools&nbsp;Accordion</a></li>
<li><a href="http://davidwalsh.name/snook-navigation-mootools" rel="bookmark" title="Permanent Link: Create Snook-Style Navigation Using MooTools">Create Snook-Style Navigation Using&nbsp;MooTools</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/88aa1_NwUJbax5jC0" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-simple-slideshow-usingmootools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MooTools Forge / GitHub Plugin Structure Shell&#160;Script</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-forge-github-plugin-structure-shellscript/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-forge-github-plugin-structure-shellscript/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 15:50:06 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[g 105]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[strict structure]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-forge-github-plugin-structure-shellscript/</guid>
		<description><![CDATA[One thing I love about the MooTools Forge is that it requires a strict structure for its plugins i.e. requiring a README.md file, Source directory, etc. I&#8217;ve created a shell script that I can run that creates the directory structure and files required to add my plugin to GitHub and then the Forge. The Shell [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I love about the MooTools Forge is that it requires a strict structure for its plugins i.e. requiring a README.md file, Source directory, etc.  I&#8217;ve created a shell script that I can run that creates the directory structure and files required to add my plugin to GitHub and then the Forge.</p>
<h2>The Shell Script &amp; Usage<br />
</h2>
<p>The first step is creating the repository at GitHub.  Once created at GitHub, I run the script, giving it the name of the plugin and repository (they must be the same):</p>
<pre>
./newPlugin.sh ScrollSpy
</pre>
<p>The script itself looks like:</p>
<pre>
#!/bin/sh
mkdir $1
cd $1
git init
touch README.md
mkdir Source
touch Source/$1.js
touch Source/$1-yui-compressed.js
mkdir Docs
touch Docs/$1.md
touch package.yml
echo &quot;name:  $1
author:  davidwalsh
current:
category:
tags:  []
docs:
demo:  &quot; &gt;&gt; package.yml;
cd $1
git add *
git commit -m &quot;First Commit&quot;
git remote add origin g&#105;&#116;&#64;g&#105;&#116;hu&#98;&#46;c&#111;&#109;:darkwing/$1.git
</pre>
<p>Tada!  Done!  Now I just need to populate each file with the necessary content. MooTools FTW!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4410"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-forge-script">MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-plugins" rel="bookmark" title="Permanent Link: Forge:  MooTools Plugin Repository">Forge:  MooTools Plugin&nbsp;Repository</a></li>
<li><a href="http://davidwalsh.name/github-merge-batch" rel="bookmark" title="Permanent Link: Create a GitHub Merge Batch File">Create a GitHub Merge Batch&nbsp;File</a></li>
<li><a href="http://davidwalsh.name/github-badge" rel="bookmark" title="Permanent Link: Represent Your Repositories Using the GitHub Badge!">Represent Your Repositories Using the GitHub&nbsp;Badge!</a></li>
<li><a href="http://davidwalsh.name/mootools-github" rel="bookmark" title="Permanent Link: Follow MooTools on GitHub!">Follow MooTools on&nbsp;GitHub!</a></li>
<li><a href="http://davidwalsh.name/script-style-feed" rel="bookmark" title="Permanent Link: Add the Script &amp; Style Feed to Your Website">Add the Script &#38; Style Feed to Your&nbsp;Website</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/abde6_MZDa4inqSpY" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-forge-github-plugin-structure-shellscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limiting Variable Scope Using&#160;(function(){})();</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/limiting-variable-scope-usingfunction/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/limiting-variable-scope-usingfunction/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 18:15:03 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[javascript code]]></category>
		<category><![CDATA[limiters]]></category>
		<category><![CDATA[scope]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[variable scope]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/limiting-variable-scope-usingfunction/</guid>
		<description><![CDATA[Simply put, a scope limiter is a self-executing function that defines a variables, performs a task, and clears those variables so that their scope is limited to the function itself. Take the following javascript code, for example: /* do task 1: */ var lynx = $$('a'); var divs = $$('div'); //(do stuff with links and [...]]]></description>
			<content:encoded><![CDATA[<p>Simply put, a scope limiter is a self-executing function that defines a variables, performs a task, and clears those variables so that their scope is limited to the function itself.  Take the following javascript code, for example:</p>
<pre>
/* do task 1:   */
var lynx = $$('a');
var divs = $$('div');
//(do stuff with links and divs)

/* do task 2 */
var lynx = $$('a'); //error:  lynx already defined!
var lis = $$('li');
//(do stuff with links and list items)
</pre>
<p>Everything above works but the second task can &#8220;see&#8221; the variables used to complete task one.  This is undesirable as those variables from the first task could cause problems with later tasks.  The better way to complete the two tasks is to use scope limiters for each:</p>
<pre>
/* do task 1:   */
(function() {
	var lynx = $$('a');
	var divs = $$('div');
	//(do stuff with links and divs)
})();

/* do task 2 */
(function() {
	var lynx = $$('a');
	var lis = $$('li');
	//(do stuff with links and list items)
})();
</pre>
<p>Sweet!  Now the variables from the first task have scope only within their executed function scope and cannot affect other javascript within the &#8220;parent&#8221; scope.</p>
<p>Clean code FTW!  Keep these techniques in mind when you&#8217;re writing code that will be repurposed!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4358"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/javascript-closures">Limiting Variable Scope Using&nbsp;(function(){})();</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/access-object-properties" rel="bookmark" title="Permanent Link: Access Javascript Object Variable Properties">Access Javascript Object Variable&nbsp;Properties</a></li>
<li><a href="http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back" rel="bookmark" title="Permanent Link: 5 Simple Ways Programmers and Designers Should Give Back">5 Simple Ways Programmers and Designers Should Give&nbsp;Back</a></li>
<li><a href="http://davidwalsh.name/php-redirect-function" rel="bookmark" title="Permanent Link: PHP Redirect Function">PHP Redirect&nbsp;Function</a></li>
<li><a href="http://davidwalsh.name/php-splat-function" rel="bookmark" title="Permanent Link: PHP Splat Function">PHP Splat&nbsp;Function</a></li>
<li><a href="http://davidwalsh.name/iphone-click" rel="bookmark" title="Permanent Link: iPhone Click Effect Using MooTools or jQuery">iPhone Click Effect Using MooTools or&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/6c908_URsxZ8mHTVQ" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/limiting-variable-scope-usingfunction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Closures:  Keeping Variable&#160;Scope</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/javascript-closures-keeping-variablescope/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/javascript-closures-keeping-variablescope/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 14:40:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[free variables]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript code]]></category>
		<category><![CDATA[lynx]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/javascript-closures-keeping-variablescope/</guid>
		<description><![CDATA[A lot of you have probably heard the term &#8220;closures&#8221; within the context of programming but aren&#8217;t sure what they are. Wikipedia defines a closure as: &#8230;a first-class function with free variables that are bound in the lexical environment. Such a function is said to be &#8220;closed over&#8221; its free variables. A closure is defined [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of you have probably heard the term &#8220;closures&#8221; within the context of programming but aren&#8217;t sure what they are.  Wikipedia defines a closure as:</p>
<blockquote><p>&#8230;a first-class function with free variables that are bound in the lexical environment. Such a function is said to be &#8220;closed over&#8221; its free variables. A closure is defined within the scope of its free variables, and the extent of those variables is at least as long as the lifetime of the closure itself.</p></blockquote>
<p>A bit technical for me.  Simply put, a closure is a self-executing function that defines a variables, performs a task, and clears those variables so that their scope is limited to the function itself.  Take the following javascript code, for example:</p>
<pre>
/* do task 1:   */
var lynx = $$('a');
var divs = $$('div');
//(do stuff with links and divs)

/* do task 2 */
var lynx = $$('a'); //error:  lynx already defined!
var lis = $$('li');
//(do stuff with links and list items)
</pre>
<p>Everything above works but the second task can &#8220;see&#8221; the variables used to complete task one.  This is undesirable as those variables from the first task could cause problems with later tasks.  The better way to complete the two tasks is to use separate closures for each:</p>
<pre>
/* do task 1:   */
(function() {
	var lynx = $$('a');
	var divs = $$('div');
	//(do stuff with links and divs)
})();

/* do task 2 */
(function() {
	var lynx = $$('a');
	var lis = $$('li');
	//(do stuff with links and list items)
})();
</pre>
<p>Sweet!  Now the variables from the first task have scope only within their closure and cannot affect other javascript within the &#8220;parent&#8221; scope.</p>
<p>Clean code FTW!  Keep these techniques in mind when you&#8217;re writing code that will be repurposed!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4358"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/javascript-closures">Javascript Closures:  Keeping Variable&nbsp;Scope</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/access-object-properties" rel="bookmark" title="Permanent Link: Access Javascript Object Variable Properties">Access Javascript Object Variable&nbsp;Properties</a></li>
<li><a href="http://davidwalsh.name/javascript-confirmation-box-alert" rel="bookmark" title="Permanent Link: Create a Javascript Confirmation Box">Create a Javascript Confirmation&nbsp;Box</a></li>
<li><a href="http://davidwalsh.name/firebug-console-log" rel="bookmark" title="Permanent Link: Logging Information to the Firebug Javascript Console">Logging Information to the Firebug Javascript&nbsp;Console</a></li>
<li><a href="http://davidwalsh.name/change-php-query-string-variable-separator-php-ini" rel="bookmark" title="Permanent Link: Change the PHP Query String Variable Separator Using php.ini">Change the PHP Query String Variable Separator Using&nbsp;php.ini</a></li>
<li><a href="http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back" rel="bookmark" title="Permanent Link: 5 Simple Ways Programmers and Designers Should Give Back">5 Simple Ways Programmers and Designers Should Give&nbsp;Back</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/e2e4b_URsxZ8mHTVQ" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/javascript-closures-keeping-variablescope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forge:  MooTools Plugin&#160;Repository</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/forge-mootools-pluginrepository/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/forge-mootools-pluginrepository/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 03:50:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[core developers]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Forge]]></category>
		<category><![CDATA[Guillermo]]></category>
		<category><![CDATA[Guillermo Rauch]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[repository structure]]></category>
		<category><![CDATA[repository system]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/forge-mootools-pluginrepository/</guid>
		<description><![CDATA[Today marks a huge day in the history of the MooTools project: the public release of the MooTools Forge. The Forge is masterful plugin repository system created by MooTools Core Developer Guillermo Rauch. The Forge currently features numerous plugins created by the Contributors and Core Developers of the MooTools team &#8212; by this time tomorrow, [...]]]></description>
			<content:encoded><![CDATA[<p>Today marks a huge day in the history of the MooTools project:  the public release of the MooTools Forge.  The Forge is masterful plugin repository system created by MooTools Core Developer Guillermo Rauch.  The Forge currently features numerous plugins created by the Contributors and Core Developers of the MooTools team &#8212; by this time tomorrow, the Forge will be (hopefully) filled with MooTools plugins from developers like yourself!</p>
<p>Without going into too much technical detail, the Forge is based on having a developer&#8217;s plugins being hosted with the GitHub system.  If you don&#8217;t have a GitHub account, I highly recommend you <a href="http://github.com/plans">create one</a>.  Once you have an account and each plugin&#8217;s repository is structured and tagged properly, you may quickly add that plugin to the Forge for the world to use!</p>
<h2>Relevant Links &amp; Guides</h2>
<ul>
<li><a href="http://mootools.net/plugins">The MooTools Forge</a> &#8211; Forge homepage.</li>
<li><a href="http://mootools.net/blog/2009/12/10/the-official-mootools-plugins-repository-is-here/">The Official MooTools Plugins Repository Is Here</a> &#8211; The official blog post with video introduction.</li>
<li><a href="http://mootools.net/plugins/how-to-add">How to Write a Plugin</a> &#8211; A great guide detailing the proper repository structure and necessary file information.  <strong>A must read.</strong></li>
<li><a href="http://mootools.net/plugins/plugin-guidelines">Plugin Writing Guidelines</a> &#8211; A quick list of ways you may improve a plugin.</li>
<li><a href="http://mootools.net/plugins/profile/davidwalsh">David Walsh&#8217;s Profile</a> &#8211; My profile on the Forge listing all of my uploaded plugins.</li>
</ul>
<h2>Special Thank You to Guillermo Rauch</h2>
<p>Guillermo&#8217;s efforts have paved the way for MooTools developers to quickly and easily share their MooTools plugins with the rest of the community.  I&#8217;d like to to thank Guillermo for his efforts &#8212; I know he worked extremely hard to create this awesome system.</p>
<h2>One Last Thing&#8230;</h2>
<p>MooTools FTW.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4350"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-plugins">Forge:  MooTools Plugin&nbsp;Repository</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/github-merge-batch" rel="bookmark" title="Permanent Link: Create a GitHub Merge Batch File">Create a GitHub Merge Batch&nbsp;File</a></li>
<li><a href="http://davidwalsh.name/keeping-mootools" rel="bookmark" title="Permanent Link: Keeping Up With MooTools">Keeping Up With&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/mootools-resources" rel="bookmark" title="Permanent Link: 5 Great MooTools Plugin Resources">5 Great MooTools Plugin&nbsp;Resources</a></li>
<li><a href="http://davidwalsh.name/mootools-github" rel="bookmark" title="Permanent Link: Follow MooTools on GitHub!">Follow MooTools on&nbsp;GitHub!</a></li>
<li><a href="http://davidwalsh.name/mootools-event-delegation" rel="bookmark" title="Permanent Link: MooTools Event Delegation">MooTools Event&nbsp;Delegation</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/705f6_gQeRuHj-2KA" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/forge-mootools-pluginrepository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone-Style Passwords Using MooTools&#160;PassShark</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/iphone-style-passwords-using-mootoolspassshark/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/iphone-style-passwords-using-mootoolspassshark/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 14:30:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[field options]]></category>
		<category><![CDATA[input password]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Luis Merino]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Nathan Querido]]></category>
		<category><![CDATA[PassShark]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[style buttons]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Every once in a while I come across a plugin that blows me out of the water and the most recent culprit is PassShark: a MooTools plugin that duplicates the iPhone&#8217;s method of showing/hiding the last character in a password field. This gem of a MooTools plugin, which conquers some problems that plague jQuery counterparts, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/88ecb_iphone-front.jpg" alt="iPhone" class="image" /></p>
<p>Every once in a while I come across a plugin that blows me out of the water and the most recent culprit is PassShark:  a MooTools plugin that duplicates the iPhone&#8217;s method of showing/hiding the last character in a password field.  This gem of a MooTools plugin, which conquers some problems that plague jQuery counterparts, was authored by valued MooTools contributors Luis Merino and Nathan Querido.</p>
<div><a href="http://davidwalsh.name/dw-content/iphone-password.php">View Demo</a>
<div></div>
</div>
<h2>The MooTools PassShark Usage</h2>
<pre>
window.addEvent('load',function() {
	new PassShark('pass',{
		interval: 300,
        	duration: 1500,
        	replacement: '%u25CF',
        	debug: false
    });
});
</pre>
<p>The only required parameter is the ID of the input/password element you&#8217;d like to act as an iPhone password field.  Options include:</p>
<ul>
<li>interval:  Amount of time between new character checks.</li>
<li>duration:  Amount of time to show a given character before obfuscating it.</li>
<li>replacement: The character to replace the character.</li>
</ul>
<p>Sometimes the less options the better!</p>
<div><a href="http://davidwalsh.name/dw-content/iphone-password.php">View Demo</a>
<div></div>
</div>
<p>PassShark is yet another perfect showcase of what MooTools allows you to accomplish.  Big ups to Luis Merino and Nathan Querido for releasing this gem.  To get more specific information about their great plugin, <a href="http://www.queridodesign.net/blog/passshark">visit their blog post</a>.  MooTools FTW!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4331"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/iphone-password">iPhone-Style Passwords Using MooTools&nbsp;PassShark</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-onload-smoothscroll" rel="bookmark" title="Permanent Link: MooTools onLoad SmoothScrolling">MooTools onLoad&nbsp;SmoothScrolling</a></li>
<li><a href="http://davidwalsh.name/dynamically-load-stylesheets-mootools" rel="bookmark" title="Permanent Link: Dynamically Load Stylesheets Using MooTools 1.2">Dynamically Load Stylesheets Using MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/text-select-widget" rel="bookmark" title="Permanent Link: New York Times-Style Text Selection Widget Using MooTools or jQuery">New York Times-Style Text Selection Widget Using MooTools or&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/skype-mootools" rel="bookmark" title="Permanent Link: Skype-Style Buttons Using MooTools">Skype-Style Buttons Using&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/iphone-checkboxes-mootools" rel="bookmark" title="Permanent Link: iPhone Checkboxes Using MooTools">iPhone Checkboxes Using&nbsp;MooTools</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/88ecb_ALDjvUyp6pM" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a><br />
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl">Related Blogs on <b>iPhone-Style Passwords Using MooTools&#160;PassShark</b></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/iphone-style-passwords-using-mootoolspassshark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Sexy Persistent Header with Opacity Using MooTools or&#160;jQuery</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-sexy-persistent-header-with-opacity-using-mootools-orjquery/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-sexy-persistent-header-with-opacity-using-mootools-orjquery/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 15:06:31 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[administrative control]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[current design]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[liking]]></category>
		<category><![CDATA[page bottom]]></category>
		<category><![CDATA[topbarME]]></category>
		<category><![CDATA[uberbar]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[Walsh]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-sexy-persistent-header-with-opacity-using-mootools-orjquery/</guid>
		<description><![CDATA[I&#8217;ve been working with the Magento eCommerce solution a lot lately and I&#8217;ve taken a liking to a technique they use with the top bar within their administrative control panel. When the user scrolls below a specified threshold, the top bar becomes attached to the top of the window and the opacity set to 50%. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with the Magento eCommerce solution a lot lately and I&#8217;ve taken a liking to a technique they use with the top bar within their administrative control panel.  When the user scrolls below a specified threshold, the top bar becomes attached to the top of the window and the opacity set to 50%.  I&#8217;ve implemented this technique in my current design and have gotten numerous requests for a tutorial so&#8230;here you go!</p>
<div>
<a href="http://davidwalsh.name/dw-content/top-bar-opacity.php">View Demo</a><br />
<a href="http://davidwalsh.name/dw-content/top-bar-opacity.php?library=jquery">View Demo</a></p>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
<div>
	<a href="http://davidwalsh.name/persistent-header-opacity#top">Top of Page</a>
	<a href="http://davidwalsh.name/persistent-header-opacity#bottom">Bottom of Page</a>
	<!-- WHATEVER YOU WANT -->
</div>
</pre>
<p>A DIV with whatever elements and structure you&#8217;d like within it.</p>
<h2>The CSS</h2>
<pre>
#uberbar	{
	border-bottom:1px solid #eb7429;
	background:#fc9453;
	padding:10px 20px;
	position:fixed;
	top:0;
	left:0;
	z-index:2000;
	width:100%;
}
</pre>
<p>Using position:fixed will allow the bar to degrade well within Internet Explorer 6 by simply keeping the bar at the top.  Be sure to position the element at 0&#215;0and set a 100% width.  You may style the DIV any way you&#8217;d like but I&#8217;d recommend keeping the height of your element to a minimum.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function() {
	(function() {
		var topbar = $('uberbar').set('tween',{ duration: 200 }), topDistance = 30, fadeTo = 0.5;
		var topbarME = function() { topbar.tween('opacity',1); }, topbarML = function() { topbar.tween('opacity',fadeTo); };
		var events = {
			mouseenter: topbarME,
			mouseleave: topbarML
		};
		var ss = new ScrollSpy({
			min: topDistance,
			max: window.getScrollSize().y + 1000,
			onLeave: function() {
				topbarME();
				topbar.removeEvents(events);
			},
			onEnter: function() {
				topbarML();
				topbar.addEvents(events);
			}
		});
	})();
});
</pre>
<p>Once all of our settings are in place, I use my <a href="http://davidwalsh.name/scrollspy">ScrollSpy plugin</a> to set minimum and maximum (enter and exit) vertical scroll values and add/remove mouseover and mouseenter events accordingly.  The events are added to return the bar t0 100% opacity when the user mouses over the bar.  ScrollSpy allows you to focus on functionality and not worry about keeping track of scroll position.  You&#8217;ll notice that I&#8217;ve not accounted for making the bar scroll in IE6 using javascript &#8212; if you&#8217;d like this effect to work in IE6, I recommend using ScrollSpy&#8217;s onTick(pos) method to position the bar while scrolling.</p>
<h2>The jQuery Javascript</h2>
<pre>
$(document).ready(function() {
	(function() {
		//settings
		var fadeSpeed = 200, fadeTo = 0.5, topDistance = 30;
		var topbarME = function() { $('#uberbar').fadeTo(fadeSpeed,1); }, topbarML = function() { $('#uberbar').fadeTo(fadeSpeed,fadeTo); };
		var inside = false;
		//do
		$(window).scroll(function() {
			position = $(window).scrollTop();
			if(position &gt; topDistance &#38;&#38; !inside) {
				//add events
				topbarML();
				$('#uberbar').bind('mouseenter',topbarME);
				$('#uberbar').bind('mouseleave',topbarML);
				inside = true;
			}
			else if (position &lt; topDistance){
				topbarME();
				$(&#039;#uberbar&#039;).unbind(&#039;mouseenter&#039;,topbarME);
				$(&#039;#uberbar&#039;).unbind(&#039;mouseleave&#039;,topbarML);
				inside = false;
			}
		});
	})();
});
</pre>
<p>The above jQuery code will accomplish the same effect.</p>
<div>
<a href="http://davidwalsh.name/dw-content/top-bar-opacity.php">View Demo</a><br />
<a href="http://davidwalsh.name/dw-content/top-bar-opacity.php?library=jquery">View Demo</a></p>
<div></div>
</div>
<p>This isn&#8217;t the type of effect you&#8217;d want to use on most websites but it can be a great utility for websites that need to be highly functional.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4312"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/persistent-header-opacity">Create a Sexy Persistent Header with Opacity Using MooTools or&nbsp;jQuery</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/animate-opacity" rel="bookmark" title="Permanent Link: Sexy Opacity Animation with MooTools or jQuery">Sexy Opacity Animation with MooTools or&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/album-art" rel="bookmark" title="Permanent Link: Sexy Album Art with MooTools or jQuery">Sexy Album Art with MooTools or&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/load-more-widget" rel="bookmark" title="Permanent Link: David Walsh on NetTuts:  Create a Twitter-Like “Load More” Widget">David Walsh on NetTuts:  Create a Twitter-Like “Load More”&nbsp;Widget</a></li>
<li><a href="http://davidwalsh.name/css-sprite-menu" rel="bookmark" title="Permanent Link: Create a Sprited Navigation Menu Using CSS and MooTools">Create a Sprited Navigation Menu Using CSS and&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/jquery-spyjax" rel="bookmark" title="Permanent Link: Ajax For Evil:  Spyjax with jQuery">Ajax For Evil:  Spyjax with&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/9bc4a_JKqCJnh8ZP8" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-a-sexy-persistent-header-with-opacity-using-mootools-orjquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create PHP Classes with Dynamic&#160;Functions</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-php-classes-with-dynamicfunctions/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-php-classes-with-dynamicfunctions/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 17:25:06 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[dynamic function]]></category>
		<category><![CDATA[dynamic functions]]></category>
		<category><![CDATA[dynamic methods]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[method arguments]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php array]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-php-classes-with-dynamicfunctions/</guid>
		<description><![CDATA[As you have probably found out, when I see something interesting I don&#8217;t know how to do, my only goal is to figure out how to do it. Thus is the case with PHP classes featuring dynamic methods based on database records (or arrays). I took some time to figure out how it was done. [...]]]></description>
			<content:encoded><![CDATA[<p>As you have probably found out, when I see something interesting I don&#8217;t know how to do, my only goal is to figure out how to do it.  Thus is the case with PHP classes featuring dynamic methods based on database records (or arrays).  I took some time to figure out how it was done.</p>
<h2>The Sample MySQL Record in a PHP Array</h2>
<pre>
$record = array(
		'id' =&gt; 12,
		'title' =&gt; 'Greatest Hits',
		'description' =&gt; 'The greatest hits from the best band in the world!'
	);
</pre>
<p>Pretend we created the above array based on a record retrieved via a MySQL query.</p>
<h2>The PHP Class with Dynamic Functions</h2>
<pre>
/* create class */
class Record {

	/* record information will be held in here */
	private $info;

	/* constructor */
	function Record($record_array) {
		$this-&gt;info = $record_array;
	}

	/* dynamic function server */
	function __call($method,$arguments) {
		$meth = $this-&gt;from_camel_case(substr($method,3,strlen($method)-3));
		return array_key_exists($meth,$this-&gt;info) ? $this-&gt;info[$meth] : false;
	}

	/* uncamelcaser: via http://www.paulferrett.com/2009/php-camel-case-functions/ */
	function from_camel_case($str) {
		$str[0] = strtolower($str[0]);
		$func = create_function('$c', 'return "_" . strtolower($c[1]);');
		return preg_replace_callback('/([A-Z])/', $func, $str);
	}
}
</pre>
<p>The first step is to create a very primitive class with a constructor which receives the record array and a __call magic method which gets executed any time a class method is called. When a method is called we parse the method name to remove &#8220;get&#8221; and check to see if the corresponding array key exists.  If the key exists, we return its value &#8212; if the key does not exist, we simple return false.</p>
<h2>The PHP Example Usage</h2>
<pre>
/* usage */
$Record = new Record(
	array(
		'id' =&gt; 12,
		'title' =&gt; 'Greatest Hits',
		'description' =&gt; 'The greatest hits from the best band in the world!'
	)
);

/* proof it works! */
echo 'The ID is:  '.$Record-&gt;getId(); // returns 12
echo 'The Title is:  '.$Record-&gt;getTitle(); // returns "Greatest Hits"
echo 'The Description is:  '.$Record-&gt;getDescription(); //returns "The greatest hits from the best band in the world!"
</pre>
<p>Above we pass the array to the class and are then able to retrieve values via the &#8220;get&#8221; functions.  Awesome!</p>
<p>The above example is not the most dynamic or realistic usage of dynamic function creation but this example will get you crawling before walking.  Let me know if you have better examples or real uses.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4323"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/dynamic-functions">Create PHP Classes with Dynamic&nbsp;Functions</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/generate-search-engine-friendly-urls-php-function" rel="bookmark" title="Permanent Link: Generate Search Engine Friendly URLs with PHP Functions">Generate Search Engine Friendly URLs with PHP&nbsp;Functions</a></li>
<li><a href="http://davidwalsh.name/dynamic-table-of-contents-mootools" rel="bookmark" title="Permanent Link: Create a Dynamic Table of Contents Using MooTools 1.2">Create a Dynamic Table of Contents Using MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/web-service-php-mysql-xml-json" rel="bookmark" title="Permanent Link: Create a Basic Web Service Using PHP, MySQL, XML, and JSON">Create a Basic Web Service Using PHP, MySQL, XML, and&nbsp;JSON</a></li>
<li><a href="http://davidwalsh.name/animated-ajax-record-deletion-mootools" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using MooTools">Animated Ajax Record Deletion Using&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/create-html-elements-php-htmlelement-class" rel="bookmark" title="Permanent Link: Create HTML Elements Using PHP: html_element Class">Create HTML Elements Using PHP: html_element&nbsp;Class</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/4a93e_82SlEjxVlYI" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/create-php-classes-with-dynamicfunctions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Reflection with jQuery and&#160;MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/image-reflection-with-jquery-andmootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/image-reflection-with-jquery-andmootools/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 16:05:05 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[canvas view]]></category>
		<category><![CDATA[Christina Ricci]]></category>
		<category><![CDATA[Christophe]]></category>
		<category><![CDATA[Christophe Beyls]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[image reflections]]></category>
		<category><![CDATA[img element]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[quot]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[usage document]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/image-reflection-with-jquery-andmootools/</guid>
		<description><![CDATA[One subtle detail that can make a big difference on any web design is the use of image reflections. Using them too often can become obnoxious but using reflections on large, &#8220;masthead&#8221; images is a classy enhancements. Unfortunately creating image reflections within your graphics application can be time-consuming, especially when an image can potentially change [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwalsh.name/dw-content/mootools-reflection.php"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/60984_ricci-reflect.png" alt="Christina Ricci" /></a></p>
<p>One subtle detail that can make a big difference on any web design is the use of image reflections.  Using them too often can become obnoxious but using reflections on large, &#8220;masthead&#8221; images is a classy enhancements.  Unfortunately creating image reflections within your graphics application can be time-consuming, especially when an image can potentially change frequently.  Luckily Christophe Beyls has created <a href="http://www.digitalia.be/software/reflectionjs-for-mootools">Reflection.js</a>.</p>
<p>Reflection.js is a javascript utility available in both jQuery and MooTools that creates reflections for any images in a page.  Reflection.js creates a new <span>IMG</span> element with special filters if the client is using IE &#8212; if the client is not IE, Reflection.js creates a <span>CANVAS</span> element and constructs the reflection within the canvas.</p>
<div><a href="http://davidwalsh.name/dw-content/mootools-reflection.php">View Demo</a>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
&lt;img src=&quot;cricci-player.jpg&quot; alt=&quot;Christina Ricci&quot; class=&quot;reflect&quot; /&gt;
</pre>
<p>Add the <span>reflect</span> CSS class to any image you&#8217;d like to reflect.</p>
<h2>The MooTools Javascript Usage<br />
</h2>
<pre>
window.addEvent('domready',function() {
	var options = { height: 0.5 };
	$$('img.reflect').each(function(img) {
		img.reflect(options);
	});
});
</pre>
<p>The MooTools version of Reflection.js implements the <span>reflect</span> method to create reflections.</p>
<h2>The jQuery Javascript Usage</h2>
<pre>
	document.ready(function() {
		var options = { opacity: 0.75 };
		$('.reflect').reflect(options);
	});
</pre>
<p>Much like MooTools method, you execute each element&#8217;s <span>reflect</span> method.</p>
<div><a href="http://davidwalsh.name/dw-content/mootools-reflection.php">View Demo</a>
<div></div>
</div>
<p>Christophe&#8217;s Reflection.js code is a great piece of work!  Don&#8217;t waste time making reflections in Photoshop &#8212; use the power of javascript!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4272"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/javascrip-reflection">Image Reflection with jQuery and&nbsp;MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/custom-missing-image-jquery" rel="bookmark" title="Permanent Link: Use Custom Missing Image Graphics Using jQuery">Use Custom Missing Image Graphics Using&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/image-php-xhtml" rel="bookmark" title="Permanent Link: Image Protection Using PHP, the GD Library, Javascript, and XHTML">Image Protection Using PHP, the GD Library, Javascript, and&nbsp;XHTML</a></li>
<li><a href="http://davidwalsh.name/mootools-image-preloading-progress-bar" rel="bookmark" title="Permanent Link: MooTools Image Preloading with Progress Bar">MooTools Image Preloading with Progress&nbsp;Bar</a></li>
<li><a href="http://davidwalsh.name/mootools-image-protector-dwprotector" rel="bookmark" title="Permanent Link: MooTools 1.2 Image Protector: dwProtector">MooTools 1.2 Image Protector:&nbsp;dwProtector</a></li>
<li><a href="http://davidwalsh.name/image-protector-plugin-for-jquery" rel="bookmark" title="Permanent Link: dwImageProtector Plugin for jQuery">dwImageProtector Plugin for&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/60984_4vYBNWFBbVk" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/image-reflection-with-jquery-andmootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing MooTools&#160;ScrollSide</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollside/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollside/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 14:51:26 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[container document]]></category>
		<category><![CDATA[container options]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[mousewheel event]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[scrollbar arrow]]></category>
		<category><![CDATA[ScrollSide]]></category>
		<category><![CDATA[true movement]]></category>
		<category><![CDATA[wheel]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollside/</guid>
		<description><![CDATA[This post is a proof of concept post &#8212; the functionality is yet to be perfected. Picture this: you&#8217;ve found yourself on a website that uses horizontal scrolling instead of vertical scrolling. It&#8217;s an artistic site so you accept that the site scrolls left to right. You&#8217;re ready to see more of the page so [...]]]></description>
			<content:encoded><![CDATA[<p><em>This post is a proof of concept post &#8212; the functionality is yet to be perfected.</em></p>
<p>Picture this: you&#8217;ve found yourself on a website that uses horizontal scrolling instead of vertical scrolling.  It&#8217;s an artistic site so you accept that the site scrolls left to right.  You&#8217;re ready to see more of the page so you use the scroll wheel like you usually do but&#8230;nothing.  Nothing happens.  Your mouse&#8217;s scroll wheel is absolutely useless. Now you have to use your browser&#8217;s scrollbar / arrow keys to see other parts of the page.  In a word: lame.</p>
<p>ScrollSide aims to prevent the problem above by hijacking the mousewheel event.  When you&#8217;ve included ScrollSide into your site, your user can use the mouse wheel to scroll up to go left and down to move right.</p>
<div>
<a href="http://davidwalsh.name/dw-content/scrollside.php">View Demo</a><br />
<a href="http://davidwalsh.name/js">Download</a></p>
<div></div>
</div>
<h2>The MooTools Plugin</h2>
<pre>
/* class begins */
var ScrollSide = new Class({

	//implements
	Implements: [Options,Events],

	//options
	options: {
		reset: true,
		movement: 75 /*,
		onScrollUp: $empty,
		onScrollDown: $empty
		*/
	},

	//initialization
	initialize: function(container,options) {
		//set options
		this.setOptions(options);
		this.container = document.id(container);
		if(this.options.reset) { this.container.scrollTo(0,0); }
		this.containerWidth = this.container.getScrollSize().x;
		this.position = this.container.getScroll().x;
		//add the listener
		this.addListeners();
	},

	//listen for scrolling
	addListeners: function() {
		/* scroll reset */
		var scrollContainer = (this.container == document.id(document.body) ? window : this.container);
		scrollContainer.addEvent('scroll',function() {
			this.position = this.container.getScroll().x;
		}.bind(this));
		/* mousewheeling */
		this.container.addEvent('mousewheel',function(event) {
			event.stop();
			//scroll down/right
			if(event.wheel &lt; 0) {
				this.fireEvent(&#039;onScrollUp&#039;,[event]);
				var pos = this.position + this.options.movement;
				this.position = (pos  0 ? pos : 0);
			}
			this.container.scrollTo(this.position,0);
		}.bind(this));
	}
});
</pre>
<p>Options for ScrollSide include:</p>
<ul>
<li><span>reset:</span> <em>(defaults to true)</em> Sets the container to the {x:0,y:0} position on instantiation.</li>
<li><span>movement:</span> <em>(defaults to 75)</em> The number of pixels to scroll on each wheel movement.</li>
</ul>
<p>Events for ScrollSide include:</p>
<ul>
<li><span>onScrollUp:</span> Fires when the user scrolls their mouse wheel up.</li>
<li><span>onScrollDown:</span> Fires when the user scrolls their mouse wheel down.</li>
</ul>
<h2>The Usage</h2>
<pre>
var ss = new ScrollSide(document.body);
</pre>
<p>Easy, simple, quick.  If you&#8217;ve created a website that scrolls from left to right, you MUST include this plugin on your site!</p>
<div>
<a href="http://davidwalsh.name/dw-content/scrollside.php">View Demo</a><br />
<a href="http://davidwalsh.name/js">Download</a></p>
<div></div>
</div>
<p>What are your thoughts about this plugin?</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=2885"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/scrollside">Introducing MooTools&nbsp;ScrollSide</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/scroll-sidebar" rel="bookmark" title="Permanent Link: Introducing MooTools ScrollSidebar">Introducing MooTools&nbsp;ScrollSidebar</a></li>
<li><a href="http://davidwalsh.name/mootools-onload-smoothscroll" rel="bookmark" title="Permanent Link: MooTools onLoad SmoothScrolling">MooTools onLoad&nbsp;SmoothScrolling</a></li>
<li><a href="http://davidwalsh.name/lazyload" rel="bookmark" title="Permanent Link: Introducing MooTools LazyLoad">Introducing MooTools&nbsp;LazyLoad</a></li>
<li><a href="http://davidwalsh.name/scrollspy" rel="bookmark" title="Permanent Link: Introducing MooTools ScrollSpy">Introducing MooTools&nbsp;ScrollSpy</a></li>
<li><a href="http://davidwalsh.name/css-enhancements-user-experience" rel="bookmark" title="Permanent Link: 7 Quick CSS Enhancements for Better User Experience">7 Quick CSS Enhancements for Better User&nbsp;Experience</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/3b674_9eTU_e-P4tI" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollside/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing MooTools&#160;ScrollSidebar</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollsidebar/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollsidebar/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 17:15:05 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Center]]></category>
		<category><![CDATA[Chris Coyier]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[div id]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[gt homepage]]></category>
		<category><![CDATA[html navigation]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[menu down]]></category>
		<category><![CDATA[navigation block]]></category>
		<category><![CDATA[quot]]></category>
		<category><![CDATA[var]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollsidebar/</guid>
		<description><![CDATA[How many times are you putting together a HTML navigation block or utility block of elements that you wish could be seen everywhere on a page? I&#8217;ve created a solution that will seamlessly allow you to do so: ScrollSidebar. ScrollSidebar allows you to attach an element to a place on the screen and animate the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwalsh.name/dw-content/scrolling-sidebar.php"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/37551_scroll-sidebar.jpg" class="image" alt="Side ScrollBar" /></a></p>
<p>How many times are you putting together a HTML navigation block or utility block of elements that you wish could be seen everywhere on a page?  I&#8217;ve created a solution that will seamlessly allow you to do so:  ScrollSidebar.  ScrollSidebar allows you to attach an element to a place on the screen and animate the menu to the current scroll position.</p>
<div><a href="http://davidwalsh.name/dw-content/scrolling-sidebar.php">View Demo</a>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
&lt;div id=&quot;sidebar-menu&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#pagetop&quot; id=&quot;sidebar-menu-top&quot; title=&quot;Top of Page&quot; style=&quot;background:url(menu-up-arrow.png) center center no-repeat;&quot;&gt;Top of Page&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;/&quot; style=&quot;background:url(menu-home.png) center center no-repeat;&quot; title=&quot;Go to the Homepage&quot;&gt;Homepage&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://twitter.com/home?status=I love David Walsh's blog!  MooTools, CSS, jQuery, PHP...it has everything!&quot; id=&quot;sidebar-menu-twitter&quot; style=&quot;background:url(menu-twitter.png) center center no-repeat;&quot; title=&quot;Share on Twitter&quot;&gt;Post on Twitter&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#pagebottom&quot; id=&quot;sidebar-menu-bottom&quot; style=&quot;background:url(menu-down-arrow.png) center center no-repeat;&quot; title=&quot;Bottom of Page&quot;&gt;Bottom of Page&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>You may code the menu&#8217;s HTML any way you&#8217;d like.  For the sake of accessibility and semantics <em>(I literally just shivered at the thought of following semantics) </em>I&#8217;ve used an HTML list.</p>
<h2>The CSS</h2>
<pre>
#sidebar-menu	{ display:none; width:48px; background:#333; border:1px solid #000; padding:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
#sidebar-menu ul{ padding:0; list-style-type:none; }
#sidebar-menu a	{ color:#fff; display:block; height:48px; width:48px; text-indent:-3000px; overflow:hidden; }
</pre>
<p>You may code the sidebar menu any way you&#8217;d like too.  No need to worry about positioning the menu though &#8212; the plugin will override that anyway.  I highly recommend addressing the menu&#8217;s width.  I&#8217;m also defaulting the menu to <span>display:none</span> until the menu can be positioned.</p>
<h2>The MooTools Javascript</h2>
<pre>
var ScrollSidebar = new Class({

	Implements: [Options],

	options: {
		offsets: { x:0, y:0 },
		mode: 'vertical',
		positionVertical: 'top',
		positionHorizontal: 'right',
		speed: 400
	},

	initialize: function(menu,options) {
		/* initial options */
		this.setOptions(options);
		this.menu = $(menu);
		this.move = this.options.mode == 'vertical' ? 'y' : 'x';
		this.property = this.move == 'y' ? 'positionVertical' : 'positionHorizontal';
		/* ensure a few things */
		var css = { position: 'absolute', display:'block' };
		css[this.options.positionVertical] = this.options.offsets.y;
		css[this.options.positionHorizontal] = this.options.offsets.x;
		this.menu.setStyles(css).set('tween',{ duration: this.options.speed });
		/* start listening */
		this.startListeners();
	},

	startListeners: function() {
		var action = function() {
			this.setPosition($(document.body).getScroll()[this.move] + this.options.offsets[this.move]);
		}.bind(this);
		window.addEvent('scroll',action);
		window.addEvent('load',action);
	},

	setPosition: function(move) {
		this.menu.tween(this.options[this.property],move);
		return this;
	}
});

/* usage */
window.addEvent('domready',function() {
	$('sidebar-menu').set('opacity',0.8); //opacity effect for fun
	var sidebar = new ScrollSidebar('sidebar-menu',{
		offsets: {
			x: 20,
			y: 20
		}
	});
});
</pre>
<p>I wont bore you with the parameter/option descriptions as they&#8217;re self-explanatory.  I&#8217;ve kept the class very simple.  For those who care to see what the functionality looked like pre-Class, here you go:</p>
<pre>
//paired with smooooothscroll
new SmoothScroll({ duration:300 });
//vars
var menu = $('sidebar-menu'), offsetY = 20, offsetX = 20, speed = 450;
var setPosition = function(top) {
	var scroll = $(document.body).getScroll();
	menu.tween('top',scroll.y + offsetY);
};
//settings
menu.set('tween',{ duration: speed }).setStyles({
	position: 'absolute',
	right: offsetX,
	top: offsetY,
	opacity: 0.8
});
//events
window.addEvents({
	scroll: setPosition,
	load: setPosition
});
</pre>
<p>As you can probably tell, the functionality was begging to be placed into plugin format.</p>
<div><a href="http://davidwalsh.name/dw-content/scrolling-sidebar.php">View Demo</a>
<div></div>
</div>
<p>Have any feature suggestions?  Share them.  If you&#8217;re looking for a sweet jQuery version, please <a href="http://css-tricks.com/scrollfollow-sidebar">head over to CSS-Tricks</a> to see Chris Coyier&#8217;s take!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=3985"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/scroll-sidebar">Introducing MooTools&nbsp;ScrollSidebar</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/lazyload" rel="bookmark" title="Permanent Link: Introducing MooTools LazyLoad">Introducing MooTools&nbsp;LazyLoad</a></li>
<li><a href="http://davidwalsh.name/mootools-watermark" rel="bookmark" title="Permanent Link: “Top” Watermark Using MooTools">&#8220;Top&#8221; Watermark Using&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/scrollspy" rel="bookmark" title="Permanent Link: Introducing MooTools ScrollSpy">Introducing MooTools&nbsp;ScrollSpy</a></li>
<li><a href="http://davidwalsh.name/css-sprite-menu" rel="bookmark" title="Permanent Link: Create a Sprited Navigation Menu Using CSS and MooTools">Create a Sprited Navigation Menu Using CSS and&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/editable-content-mootools-php-mysql" rel="bookmark" title="Permanent Link: Editable Content Using MooTools 1.2, PHP, and MySQL">Editable Content Using MooTools 1.2, PHP, and&nbsp;MySQL</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/fe2a7_AqZ-1QGmPPI" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/introducing-mootoolsscrollsidebar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What I&#8217;m Thankful For: 2009 Web&#160;Edition</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/what-im-thankful-for-2009-webedition/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/what-im-thankful-for-2009-webedition/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 16:05:05 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Aaron Newton]]></category>
		<category><![CDATA[babel fish]]></category>
		<category><![CDATA[Chelsea]]></category>
		<category><![CDATA[chelsea fan]]></category>
		<category><![CDATA[Chris Coyier]]></category>
		<category><![CDATA[crappy sites]]></category>
		<category><![CDATA[Darren Waddell]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[driven group]]></category>
		<category><![CDATA[Eric Wendelin]]></category>
		<category><![CDATA[errors of my ways]]></category>
		<category><![CDATA[League]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Rey Bango]]></category>
		<category><![CDATA[team]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/what-im-thankful-for-2009-webedition/</guid>
		<description><![CDATA[I&#8217;d like to take a moment this Thanksgiving to thank some people that deserved to be. I&#8217;d like to thank the MooTools team for all of the support and hard work. I feel truly honored to be around such intelligent, driven group of individuals. I&#8217;d like to specifically thank Aaron Newton and Valerio Proietti for [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/5af0f_sexy-turkey.jpg" alt="Turkey" class="image" /></p>
<p>I&#8217;d like to take a moment this <a href="http://en.wikipedia.org/wiki/Thanksgiving">Thanksgiving</a> to thank some people that deserved to be.</p>
<ul>
<li>I&#8217;d like to thank the MooTools team for all of the support and hard work.  I feel truly honored to be around such intelligent, driven group of individuals.  I&#8217;d like to specifically thank Aaron Newton and Valerio Proietti for being great leaders and advisers.  MooTools FTW.</li>
<li>I&#8217;d like to thank members of the MooTools community for all of their hard work.  Sometimes I don&#8217;t think we all realize just how much we&#8217;re changing the web.  Keep up the good work MooToolers!</li>
<li>I&#8217;d like to thank friends like Chris Coyier and Eric Wendelin for letting me bounce ideas off of them, however rubbish they may be.</li>
<li>I&#8217;d like to thank Babel Fish for allowing me to easily translate senseless phrases to other languages so that I may send said messages to foreign members of the MooTools team.</li>
<li>I&#8217;d like to thank Rey Bango for being my whipping boy whenever I need to talk smack to someone.</li>
<li>I&#8217;d like to thank Twitter for creating a service that allows me to be riveting in 140 characters or less.</li>
<li>I&#8217;d like to thank DirecTv for allowing to purchase not one but two soccer packages.  I get to see EPL, SPL, La Liga, Serie A, Bundesliga, Ligue, Russian League, and Champhions League.  In turn I&#8217;d like to thank Darren Waddell for being patient with me as I ask questions and initially attempted to be a Chelsea fan.  I&#8217;ve seen the errors of my ways:  go Gunners!</li>
<li>I&#8217;d like to thank Internet Explorer for continuing to encourage my creativity and making me think out each piece of my javascript code.</li>
<li>I&#8217;d like to thank my advertisers who are unknowingly paying for the rock I just bought.</li>
<li>I&#8217;d like to thank all of the crappy sites our there for giving me so many ideas for improvements.</li>
<li>I&#8217;d like to thank the developers and designers that follow me here, provide encouragement and constructive criticism, and reach out to help with projects.  You guys make all the time I spend on this blog worth it.</li>
</ul>
<p>Thank you again!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4307"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/thanksgiving-2009">What I&#8217;m Thankful For: 2009 Web&nbsp;Edition</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/blog-goals-2009" rel="bookmark" title="Permanent Link: Blog Goals for 2009">Blog Goals for&nbsp;2009</a></li>
<li><a href="http://davidwalsh.name/thanksgiving-2008" rel="bookmark" title="Permanent Link: What I’m Thankful For: 2008 Edition">What I&#8217;m Thankful For: 2008&nbsp;Edition</a></li>
<li><a href="http://davidwalsh.name/web-predictions-2009" rel="bookmark" title="Permanent Link: Web Predictions For 2009">Web Predictions For&nbsp;2009</a></li>
<li><a href="http://davidwalsh.name/faces-of-moo" rel="bookmark" title="Permanent Link: Faces of Moo: Represent Your Framework!">Faces of Moo: Represent Your&nbsp;Framework!</a></li>
<li><a href="http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back" rel="bookmark" title="Permanent Link: 5 Simple Ways Programmers and Designers Should Give Back">5 Simple Ways Programmers and Designers Should Give&nbsp;Back</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/5af0f_7ZKqYvYaut8" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/what-im-thankful-for-2009-webedition/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Access Javascript Object Variable&#160;Properties</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/access-javascript-object-variableproperties/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/access-javascript-object-variableproperties/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 14:50:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript object]]></category>
		<category><![CDATA[javascript objects]]></category>
		<category><![CDATA[MyObject]]></category>
		<category><![CDATA[property]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[var]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/access-javascript-object-variableproperties/</guid>
		<description><![CDATA[Not all javascript objects are as easy as MyObject.property. Sometimes you may want to access a property whose key is stored in a variable. Luckily accessing these properties is very easy. Javascript Object Property Accessing Example /* setting */ var myObject = { left : 30, top: 20 }; /* basic access */ var left [...]]]></description>
			<content:encoded><![CDATA[<p>Not all javascript objects are as easy as MyObject.property.  Sometimes you may want to access a property whose key is stored in a variable.  Luckily accessing these properties is very easy.</p>
<h2>Javascript Object Property Accessing Example</h2>
<pre>
/* setting */
var myObject = {
	left : 30,
	top: 20
};
/* basic access */
var left = myObject.left; //OR
var left = myObject['left'];

/* accessing it or variables */
var mode = 'vertical';
var value = myObject[mode == 'horizontal' ? 'left' : 'top'];
</pre>
<p>You may use array-style syntax to access an object&#8217;s properties.  The string within brackets returns the properties.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4252"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/access-object-properties">Access Javascript Object Variable&nbsp;Properties</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/javascript-arrays-brackets-braces" rel="bookmark" title="Permanent Link: Javascript Arrays: The Difference Between [] and { }">Javascript Arrays: The Difference Between [] and {&nbsp;}</a></li>
<li><a href="http://davidwalsh.name/parse-code-regex" rel="bookmark" title="Permanent Link: Code-Parsing Regular Expressions via Lighter.js">Code-Parsing Regular Expressions via&nbsp;Lighter.js</a></li>
<li><a href="http://davidwalsh.name/implementing-array-count-method-javascript" rel="bookmark" title="Permanent Link: Implementing an Array.count() Method in Javascript">Implementing an Array.count() Method in&nbsp;Javascript</a></li>
<li><a href="http://davidwalsh.name/window-object-dump" rel="bookmark" title="Permanent Link: MooTools Window Object Dumping">MooTools Window Object&nbsp;Dumping</a></li>
<li><a href="http://davidwalsh.name/firebug-console-log" rel="bookmark" title="Permanent Link: Logging Information to the Firebug Javascript Console">Logging Information to the Firebug Javascript&nbsp;Console</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/a8555_V_GeuV_NTEA" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/access-javascript-object-variableproperties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>META Refresh vs. Javascript&#160;Refresh</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/meta-refresh-vs-javascriptrefresh/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/meta-refresh-vs-javascriptrefresh/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 14:25:04 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code lt]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[internet explorer 7]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[META Refresh]]></category>
		<category><![CDATA[meta tag]]></category>
		<category><![CDATA[opera internet]]></category>
		<category><![CDATA[quot]]></category>
		<category><![CDATA[refresh]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/meta-refresh-vs-javascriptrefresh/</guid>
		<description><![CDATA[A few days back I was perusing the ESPN.com source code when I found the following snippet of code: &#60;script&#62; ESPN_refresh=window.setTimeout(function(){window.location.href=window.location.href},900000); &#60;/script&#62; &#60;noscript&#62; &#60;meta http-equiv=&#34;refresh&#34; content=&#34;900&#34; /&#62; &#60;/noscript&#62; I understand what the code was supposed to do but was confused as to why they&#8217;d use javascript as a primary method and META as a fallback [...]]]></description>
			<content:encoded><![CDATA[<p>A few days back I was perusing the ESPN.com source code when I found the following snippet of code:</p>
<pre>
&lt;script&gt;
	ESPN_refresh=window.setTimeout(function(){window.location.href=window.location.href},900000);
&lt;/script&gt;
&lt;noscript&gt;
	&lt;meta http-equiv=&quot;refresh&quot; content=&quot;900&quot; /&gt;
&lt;/noscript&gt;
</pre>
<p>I understand what the code was supposed to do but was confused as to why they&#8217;d use javascript as a primary method and META as a fallback method.  Why not just use the META method?  I did some research and found the answer at Wikipedia:</p>
<blockquote><p>Use of meta refresh is discouraged by the W3C, since unexpected refresh can disorient users. Meta refresh also impairs the web browser&#8217;s &#8220;back&#8221; button in some browsers (including Internet Explorer 6 and before), although most modern browsers compensate for this (Mozilla Firefox, Opera, Internet Explorer 7).</p></blockquote>
<p>So there you have it.  Use javascript as your primary means for automatic page refreshes and a META tag as your fallback.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4298"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/meta-refresh-javascript">META Refresh vs. Javascript&nbsp;Refresh</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/automatically-refresh-page-javascript-meta-tags" rel="bookmark" title="Permanent Link: Automatically Refresh a Page Using Javascript or Meta Tags">Automatically Refresh a Page Using Javascript or Meta&nbsp;Tags</a></li>
<li><a href="http://davidwalsh.name/create-javascript-refresh-link" rel="bookmark" title="Permanent Link: Create a Javascript Refresh Link">Create a Javascript Refresh&nbsp;Link</a></li>
<li><a href="http://davidwalsh.name/override-windows-vista-xp-themed-buttons-scrollbars-meta-tag" rel="bookmark" title="Permanent Link: Override Vista and XP’s Themed Buttons and Scrollbars Using a META Tag">Override Vista and XP&#8217;s Themed Buttons and Scrollbars Using a META&nbsp;Tag</a></li>
<li><a href="http://davidwalsh.name/break-out-frames" rel="bookmark" title="Permanent Link: Break Out of Frames Using Javascript">Break Out of Frames Using&nbsp;Javascript</a></li>
<li><a href="http://davidwalsh.name/browser-301-redirects" rel="bookmark" title="Permanent Link: Adios Means Goodbye – Browser 301 Redirects In All Languages">Adios Means Goodbye &#8211; Browser 301 Redirects In All&nbsp;Languages</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/f1f61_qiCWcdL4DkQ" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/meta-refresh-vs-javascriptrefresh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Better Pull Quotes with&#160;MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/better-pull-quotes-withmootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/better-pull-quotes-withmootools/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 16:50:05 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[background color]]></category>
		<category><![CDATA[Chris]]></category>
		<category><![CDATA[Chris Coyier]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[new element]]></category>
		<category><![CDATA[padding]]></category>
		<category><![CDATA[quote]]></category>
		<category><![CDATA[span]]></category>
		<category><![CDATA[span class]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/better-pull-quotes-withmootools/</guid>
		<description><![CDATA[Chris Coyier authored a post titled Better Pull Quotes: Don&#8217;t Repeat Markup a while back. In his post he created great-looking pull quotes without repeating any content &#8212; instead he uses jQuery to dynamically create the pull quotes. The following is the MooTools method for doing so. View Demo The HTML &#60;p&#62;&#60;span class=&#34;pull-me&#34;&#62;As a MooTools [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwalsh.name/dw-content/mootools-pull-quote.php"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/fce5d_pullquotes.png" alt="Pull Quotes" /></a></p>
<p>Chris Coyier authored a post titled <a href="http://css-tricks.com/better-pull-quotes/">Better Pull Quotes: Don&#8217;t Repeat Markup</a> a while back.  In his post he created great-looking pull quotes without repeating any content &#8212; instead he uses jQuery to dynamically create the pull quotes.  The following is the MooTools method for doing so.</p>
<div><a href="http://davidwalsh.name/dw-content/mootools-pull-quote.php">View Demo</a>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
&lt;p&gt;&lt;span class=&quot;pull-me&quot;&gt;As a MooTools &quot;insider&quot;, however, I'm excited for what the MooTools team will bring to the table during 2010.&lt;/span&gt; We'll be launching the Forge (our public plugin repository), releasing MooTools 2, continuing to grow MooTools More, featuring more community work, and much more. MooTools FTW!&lt;/p&gt;
</pre>
<p>The HTML above features a paragraph of content with a SPAN tag wrapping what I&#8217;d like to be the pull quote.</p>
<h2>The CSS</h2>
<pre>
.quote { padding:20px; margin:0 0 20px 20px; font-size:20px; font-style:italic; background:#eee; color:#999; display:block; width:200px; float:right; }
</pre>
<p>You may style the quote any way you&#8217;d like.  These elements are traditionally large in text with italicized text and a different background color.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function() {
	//grab all quotes
	$$('span.pull-me').each(function(span) {
		//inject styled quote into page
		new Element('span',{
			'class': 'quote',
			text: span.get('text')
		}).inject(span.getParent(),'top');
	});
});
</pre>
<p>We find each element with a &#8220;pull-me&#8221; CSS class and generate a new element with our &#8220;quote&#8221; class.  We then inject the new element into the original element&#8217;s parent.  That&#8217;s all!</p>
<div><a href="http://davidwalsh.name/dw-content/mootools-pull-quote.php">View Demo</a>
<div></div>
</div>
<p>Chris did a great job with the execution of his idea.  This is a technique that will likely be used well into the future.</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4292"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-pull-quotes">Better Pull Quotes with&nbsp;MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/highlight-table-columns" rel="bookmark" title="Permanent Link: Highlight Table Rows, Columns, and Cells Using MooTools 1.2.3">Highlight Table Rows, Columns, and Cells Using MooTools&nbsp;1.2.3</a></li>
<li><a href="http://davidwalsh.name/predictions-2010" rel="bookmark" title="Permanent Link: Bold Web Predictions for 2010">Bold Web Predictions for&nbsp;2010</a></li>
<li><a href="http://davidwalsh.name/mootools-html-police-dwmarkupmarine" rel="bookmark" title="Permanent Link: MooTools HTML Police: dwMarkupMarine">MooTools HTML Police:&nbsp;dwMarkupMarine</a></li>
<li><a href="http://davidwalsh.name/method-chaining" rel="bookmark" title="Permanent Link: Method Chaining in MooTools and PHP">Method Chaining in MooTools and&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/image-protector-plugin-for-jquery" rel="bookmark" title="Permanent Link: dwImageProtector Plugin for jQuery">dwImageProtector Plugin for&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/fce5d_NCxy8TQwalw" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/better-pull-quotes-withmootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools OpenLinks Class &#8211;&#160;Updated</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-openlinks-class-updated/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-openlinks-class-updated/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 13:50:03 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[class implements]]></category>
		<category><![CDATA[class option]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[file extensions]]></category>
		<category><![CDATA[href]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[OpenLinks]]></category>
		<category><![CDATA[setproperty]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[target target]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-openlinks-class-updated/</guid>
		<description><![CDATA[A long time back I coded a MooTools class called OpenLinks. The class is quite useful but the code&#8230;sucks. I&#8217;ve gotten much better with MooTools over the past years so I thought I&#8217;d go back and update the class to be better, faster, etc. View Demo The Original MooTools Class /* classes */ var OpenLinks [...]]]></description>
			<content:encoded><![CDATA[<p>A long time back I <a href="http://davidwalsh.name/mootools-open-links-plugin">coded a MooTools class called OpenLinks</a>.  The class is quite useful but the code&#8230;sucks.  I&#8217;ve gotten much better with MooTools over the past years so I thought I&#8217;d go back and update the class to be better, faster, etc.</p>
<div><a href="http://davidwalsh.name/dw-content/open-links-updated.php">View Demo</a>
<div></div>
</div>
<h2>The Original MooTools Class</h2>
<pre>
/* classes */
var OpenLinks = new Class({
	//initialization
	initialize: function(file_extensions,override_targets,target,no_class) {

		//analyze all anchors
		$$('a').each(function(el) {

			//check each href for case-insensitive file extensions
			var str = el.get('href');
			var ext = str.substring(str.lastIndexOf('.') + 1,str.length)
			if(file_extensions.contains(ext.toLowerCase()) &#38;&#38; ((override_targets || !el.get('target')) &#38;&#38; !el.hasClass(no_class + '')))
			{
				el.setProperty('target',target ? target : '_blank');
				el.setStyle('color','#f00');
			}
		});
	}
});
</pre>
<p>Gross.  Everything is an argument and the no_class argument is pointless since you can simply disqualify items in the elements option selector string.</p>
<h2>The New MooTools Javascript</h2>
<pre>
/* class */
var OpenLinks = new Class({

	Implements: [Options],

	options: {
		elements: 'a',
		extensions: [],
		target: '_blank',
		overrideTarget: true
	},

	initialize: function(options) {
		this.setOptions(options);
		$$(this.options.elements).each(this.assign,this);
	},

	assign: function(el) {
		var href = 	el.get('href'), ext = href.substring(href.lastIndexOf('.') + 1,href.length).toLowerCase();
		if(this.options.extensions.contains(ext) &#38;&#38; (this.options.overrideTarget || !el.get('target'))) {
			el.set('target',this.options.target);
			el.setStyle('color','#f00');
		}
	}

});
</pre>
<p>Instead of making everything arguments I moved each argument into the options object.  I also removed the no_class option/parameter.</p>
<h2>The MooTools Usage</h2>
<pre>
/* usage */
window.addEvent('load',function() {
	var openers = new OpenLinks({
		extensions: ['pdf','xls','doc','jpg'],
		elements: '#content a'
	});
});
</pre>
<p>Using OpenLinks is as easy as it should be!</p>
<div><a href="http://davidwalsh.name/dw-content/open-links-updated.php">View Demo</a>
<div></div>
</div>
<p>It feels good to clean up code after a long time.  I recommend you do so when you can too!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4220"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/openlinks-plugin">MooTools OpenLinks Class &#8211;&nbsp;Updated</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-open-links-plugin" rel="bookmark" title="Permanent Link: MooTools 1.2 OpenLinks Plugin">MooTools 1.2 OpenLinks&nbsp;Plugin</a></li>
<li><a href="http://davidwalsh.name/simple-mootools-event-class-binding" rel="bookmark" title="Permanent Link: Simple MooTools Event / Class Binding">Simple MooTools Event / Class&nbsp;Binding</a></li>
<li><a href="http://davidwalsh.name/6-reasons-to-use-javascript-libraries-frameworks" rel="bookmark" title="Permanent Link: 6 Reasons To Use Javascript Libraries &amp; Frameworks">6 Reasons To Use Javascript Libraries &#38;&nbsp;Frameworks</a></li>
<li><a href="http://davidwalsh.name/mootools-class-tips" rel="bookmark" title="Permanent Link: MooTools Class Creation Tips">MooTools Class Creation&nbsp;Tips</a></li>
<li><a href="http://davidwalsh.name/create-color-palette-css-mootools" rel="bookmark" title="Permanent Link: Guest Blog: Create a Color Palette Using CSS and MooTools 1.2">Guest Blog: Create a Color Palette Using CSS and MooTools&nbsp;1.2</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/eacae_6y3b4GNyUWk" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/mootools-openlinks-class-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax For Evil:  Spyjax with&#160;jQuery</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ajax-for-evil-spyjax-withjquery/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ajax-for-evil-spyjax-withjquery/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 16:15:18 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[anchor links]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[color rgb]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[css tricks]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[document body]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[page]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ajax-for-evil-spyjax-withjquery/</guid>
		<description><![CDATA[Last year I wrote a popular post titled Ajax For Evil: Spyjax when I described a technique called &#8220;Spyjax&#8221;: Spyjax, as I know it, is taking information from the user’s computer for your own use — specifically their browsing habits. By using CSS and javascript, I can inject anchor links into the page and tell [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I wrote a popular post titled Ajax For Evil:  Spyjax when I described a technique called &#8220;Spyjax&#8221;:</p>
<blockquote><p>Spyjax, as I know it, is taking information from the user’s computer for your own use — specifically their browsing habits. By using CSS and javascript, I can inject anchor links into the page and tell whether you’ve been to the link’s URL. How? Quite easy actually.</p></blockquote>
<p>I&#8217;ve taken the time to demonstrate this technique using jQuery.</p>
<div>
<a href="http://davidwalsh.name/dw-content/jquery-spyjax.php">View Basic Demo</a><br />
<a href="http://davidwalsh.name/dw-content/jquery-spyjax-advanced.php">View Advanced Demo</a></p>
<div></div>
</div>
<h2>The CSS</h2>
<pre>
a.checkme			{ color:#00ff00; }
a.checkme:visited	{ color:#ff0000; }
</pre>
<p>The most important part of the CSS is the difference in &#8220;:link&#8221; and &#8220;:visited&#8221; color;  the method by which we can tell if a site has been visited is by its link color being the &#8220;:visited&#8221; color.</p>
<h2>The jQuery Javascript</h2>
<pre>
//when the page is ready
$(document).ready(function() {
	//the list of domains to check and an array which will store hits
	var domains = ['davidwalsh.name','css-tricks.com','scriptandstyle.com','cnn.com','digg.com'];
	var visited = [];
	//for every domain...
	$.each(domains,function() {
		//inject a link into page
		var a = $('<a></a>').attr({
			href: 'http://' + this,
			'class': 'checkme'
		}).appendTo(document.body);
		//check the color of the link
		if($(a).css('color') == '#ff0000' || $(a).css('color') == 'rgb(255, 0, 0)') { //either format of color
			$(a).addClass('highlight');
			visited.push(this);
		}
		//remove from the page -- no longer need the links
		a.remove();
	});
	if(visited.length) {
		//save via ajax!  shady!
		//display items on the page based on "hits"
	}
});
</pre>
<p>We start by injecting a bunch of hidden links into the page (unbeknownst to the user).  For each link we&#8217;ve injected into the page, our jQuery javascript grabs the link color &#8212; if the link&#8217;s color matches the designated &#8220;:visited&#8221; link color we set via CSS, we&#8217;ve found a site the user&#8217;s been to.  Of course we can do anything we want with that information, including saving it via AJAX.  Why?  Well, if we know a user has been to Digg.com, maybe we show the Digg &#8220;share&#8221; icon instead of the Reddit icon.</p>
<h2>The MooTools Javascript</h2>
<pre>
var domains = ['davidwalsh.name','css-tricks.com','scriptandstyle.com','cnn.com','digg.com'];
var visited = [];
domains.each(function(url) {
	var anchor = new Element('a', {
		href: 'http://' + url,
		'class': 'checkme',
		html: url
	}).inject(document.body);
	if(anchor.getStyle('color') == '#ff0000') {
		visited.push(url);
	}
	anchor.dispose();
});
</pre>
<p>The above code accomplishes the same task using MooTools as outlined in my <a href="http://davidwalsh.name/ajax-evil-spyjax">previous Spyjax post</a>.</p>
<div>
<a href="http://davidwalsh.name/dw-content/jquery-spyjax.php">View Basic Demo</a><br />
<a href="http://davidwalsh.name/dw-content/jquery-spyjax-advanced.php">View Advanced Demo</a></p>
<div></div>
</div>
<p>What are your thoughts on Spyjax?  Harmless?  Major privacy violation?  You tell me!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4223"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/jquery-spyjax">Ajax For Evil:  Spyjax with&nbsp;jQuery</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/ajax-evil-spyjax" rel="bookmark" title="Permanent Link: Ajax For Evil: Spyjax">Ajax For Evil:&nbsp;Spyjax</a></li>
<li><a href="http://davidwalsh.name/animated-ajax-jquery" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using jQuery">Animated Ajax Record Deletion Using&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/ajax-spinner-jquery" rel="bookmark" title="Permanent Link: Form Element AJAX Spinner Attachment Using jQuery">Form Element AJAX Spinner Attachment Using&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/jquery-top-link" rel="bookmark" title="Permanent Link: jQuery topLink Plugin">jQuery topLink&nbsp;Plugin</a></li>
<li><a href="http://davidwalsh.name/color-palette-generator-jquery" rel="bookmark" title="Permanent Link: Color Palette Generator Using jQuery">Color Palette Generator Using&nbsp;jQuery</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/28658_7yVhw8lV2j8" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/ajax-for-evil-spyjax-withjquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using MooTools&#160;Periodicals</title>
		<link>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-mootoolsperiodicals/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-mootoolsperiodicals/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:10:18 +0000</pubDate>
		<dc:creator>Facebook-Web-Design</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[interval]]></category>
		<category><![CDATA[intervals]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[periodical]]></category>
		<category><![CDATA[periodicalID]]></category>
		<category><![CDATA[periodicals]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[var]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-mootoolsperiodicals/</guid>
		<description><![CDATA[If I were to explain MooTools in a sentence I&#8217;d say &#8220;MooTools makes common javascript tasks exponentially easier and the code more elegant.&#8221; Dealing with intervals in javascript is fairly simple but not so elegant. Here&#8217;s MooTools&#8217;s take on setInterval. Basic Function.periodical Usage /* the function to repeatedly run */ var fnToRepeat = function() { [...]]]></description>
			<content:encoded><![CDATA[<p>If I were to explain MooTools in a sentence I&#8217;d say &#8220;MooTools makes common javascript tasks exponentially easier and the code more elegant.&#8221;  Dealing with intervals in javascript is fairly simple but not so elegant.  Here&#8217;s MooTools&#8217;s take on <span>setInterval</span>.</p>
<h2>Basic Function.periodical Usage</h2>
<pre>
/* the function to repeatedly run */
var fnToRepeat = function() {
	console.log('Running periodical!');
};
/* set periodical into action!  once every second */
var periodicalID = fnToRepeat.periodical(1000);
</pre>
<p>The above function will run periodically every second.  This method takes the place of javascript&#8217;s native <span>setInterval</span> &#8212; periodical Moo-izes setInterval.  You&#8217;ll also notice that this method returns the interval ID.</p>
<h2>Clearing Periodicals with $clear</h2>
<pre>
/* the function to repeatedly run */
var count = 0;
var fnToRepeat = function() {
	count++;
	console.log('Periodical run ' + count + ' times');
	if(count == 10) {
		$clear(periodicalID);
	}
};
/* do only 10 times, once every second */
var periodicalID = fnToRepeat.periodical(1000);
</pre>
<p>When you no longer want the periodical to run, you simply use MooTools&#8217; global <span>$clear</span> method.  That&#8217;s it &#8212; the periodical stops for good.  You may initialize another periodical with the same function however a new interval ID will be returned.</p>
<h2>Real-Life Example</h2>
<p>I was required to write a slideshow of sorts for a client which would periodically swap slides.  The periodical was meant to continue &#8220;forever&#8221; but stop when the mouse hovered other the displaying slide, then start again when the mouse left.  Here&#8217;s how I did it:</p>
<pre>
/* setup */
var periodicalID;
var begin = function() {
	periodicalID = (function() {
		//do all the rotation stuff here
	}).periodical(5000);
}
/* start it! */
begin();
/* events ("start" / "stop") */
$('slider-container').addEvents({
	mouseenter: function() {
		//temporarily stop
		$clear(periodicalID);
	},
	mouseleave: begin
});
</pre>
<p>Note that I didn&#8217;t &#8220;pause&#8221; the periodical per say &#8212; I simply stopped the periodical and started a new interval when the mouse left the slide area.</p>
<p>Periodicals are an essential functionality in javascript that MooTools has more elegantly presented.  MooTools FTW!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4195"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mootools-periodical">Using MooTools&nbsp;Periodicals</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/periodical-ajax-requests-mootools-12" rel="bookmark" title="Permanent Link: Periodical Ajax Requests Using MooTools 1.2">Periodical Ajax Requests Using MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/mootools-shake" rel="bookmark" title="Permanent Link: MooTools Fun with Fx.Shake">MooTools Fun with&nbsp;Fx.Shake</a></li>
<li><a href="http://davidwalsh.name/jquery-shake" rel="bookmark" title="Permanent Link: Shake Things Up Using jQuery UI’s Shake Effect">Shake Things Up Using jQuery UI&#8217;s Shake&nbsp;Effect</a></li>
<li><a href="http://davidwalsh.name/mootools-dotter" rel="bookmark" title="Permanent Link: Introducing MooTools Dotter">Introducing MooTools&nbsp;Dotter</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/66009_nv4c_IvyHpA" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/facebook-web-design/web-resources/using-mootoolsperiodicals/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search Type Options with&#160;MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/search-type-options-withmootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/search-type-options-withmootools/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:18:50 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[css search]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[div id]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[google yahoo]]></category>
		<category><![CDATA[html structure]]></category>
		<category><![CDATA[quot]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/search-type-options-withmootools/</guid>
		<description><![CDATA[Advanced search engines like Google, Yahoo!, and Bing have discovered the obvious: one type of search isn&#8217;t good enough. The big search engines offer web search, video search, code search, blog search, image search, and any other type of search you can think of. Of course they could use different search boxes on different pages [...]]]></description>
			<content:encoded><![CDATA[<p>Advanced search engines like Google, Yahoo!, and Bing have discovered the obvious:  one type of search isn&#8217;t good enough.  The big search engines offer web search, video search, code search, blog search, image search, and any other type of search you can think of.  Of course they could use different search boxes on different pages but that&#8217;s annoying.  Using a bit of javascript we can consolidate all of our search types into one box.</p>
<div><a href="http://davidwalsh.name/dw-content/search-options.php">View Demo</a>
<div></div>
</div>
<h2>The HTML / PHP</h2>
<pre>
&lt;p&gt;Click on the search type headers above the search box to change the type of search you'd like to make!'&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;search-container&quot; style=&quot;width:500px&quot;&gt;
	&lt;div id=&quot;search-options&quot;&gt;
		&lt;a href=&quot;?type=web&quot; &lt;?php if($_GET['type'] != 'video' &amp;&amp; $_GET['type'] != 'image') { echo 'class=&quot;web active&quot;'; } ?&gt; style=&quot;left:20px;&quot;&gt;Web&lt;/a&gt;
		&lt;a href=&quot;?type=image&quot; &lt;?php if($_GET['type'] == 'image') { echo 'class=&quot;image active&quot;'; } ?&gt; style=&quot;left:70px;&quot;&gt;Image&lt;/a&gt;
		&lt;a href=&quot;?type=video&quot; &lt;?php if($_GET['type'] == 'video') { echo 'class=&quot;video active&quot;'; } ?&gt; style=&quot;left:140px;&quot;&gt;Video&lt;/a&gt;
	&lt;/div&gt;
	&lt;form method=&quot;get&quot; action=&quot;/search/web&quot; id=&quot;search-form&quot;&gt;
		&lt;input type=&quot;text&quot; id=&quot;query&quot; name=&quot;query&quot; /&gt;
		&lt;input type=&quot;submit&quot; value=&quot;&lt;?php echo ucwords($_GET['type'] == 'video' || $_GET['type'] == 'image' ? $_GET['type'] : 'web'); ?&gt; Search&quot; name=&quot;submit&quot; id=&quot;submit&quot; /&gt;
	&lt;/form&gt;
&lt;/div&gt;
</pre>
<p>The HTML structure is simple &#8212; be mindful of the element ID&#8217;s for styling and javascript functionality.</p>
<h2>The CSS</h2>
<pre>
#search-container	{ position:relative; padding:10px; -moz-border-radius:10px; -webkit-border-radius:10px; }
#search-options		{  }
	#search-options a	{ top:-20px; position:absolute; font-size:11px; padding:3px 6px; color:#00f; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; -webkit-border-top-left-radius:5px; -webkit-border-top-right-radius:5px; }
	#search-options a.active	{ z-index:5; text-decoration:none; font-weight:bold; color:#000; }
#query 				{ font-size:24px; padding:4px; background:#fff; }
#submit				{ font-size:24px; }

.web				{ background:#ccc; }
.images				{ background:#fffea1; }
.videos				{ background:lightblue; }
</pre>
<p>Style at will!</p>
<h2>The MooTools</h2>
<pre>
window.addEvent('domready',function() {
	var lynx = $$('#search-options a'), activeItem = $$('#search-options a.active')[0] || lynx[0], button = $('submit'), oTerm = 'Search';
	var searchForm = $('search-form'), container = $('search-container').set('class',activeItem.get('text').toLowerCase());
	lynx.addEvent('click',function(e) {
		//brick event
		e.stop();
		//manage "active" class
		activeItem.className = '';
		this.addClass('active ' + this.get('text').toLowerCase());
		activeItem = this;
		//manage URL and color class
		searchForm.set('action',this.get('href'));
		container.className = this.get('class');
		button.set('value',this.get('text') + ' ' + oTerm);
	});
});
</pre>
<p>The system works off of a system of adding and removing CSS class names.  We also swap the form actions through each search type click.</p>
<div><a href="http://davidwalsh.name/dw-content/search-options.php">View Demo</a>
<div></div>
</div>
<p>Mapping out the the functionality for a system like this is fairly simple.  What sets these type of systems is the great styling.  Post in the comments if you&#8217;ve implemented a system like this!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4065"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/search-options">Search Type Options with&nbsp;MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/open-search" rel="bookmark" title="Permanent Link: Add Your Website to Firefox’s Search Bar Using OpenSearch XML">Add Your Website to Firefox&#8217;s Search Bar Using OpenSearch&nbsp;XML</a></li>
<li><a href="http://davidwalsh.name/msn-live-search-result-grabber" rel="bookmark" title="Permanent Link: MSN Live Search Result Grabber">MSN Live Search Result&nbsp;Grabber</a></li>
<li><a href="http://davidwalsh.name/yahoo-seo-domain-result-grabber" rel="bookmark" title="Permanent Link: Yahoo SEO Domain Result Grabber">Yahoo SEO Domain Result&nbsp;Grabber</a></li>
<li><a href="http://davidwalsh.name/default-search-input-message-show-replace" rel="bookmark" title="Permanent Link: Default Search Input Message — Show &amp; Replace">Default Search Input Message &#8212; Show &#38;&nbsp;Replace</a></li>
<li><a href="http://davidwalsh.name/google-code-search-swear-words" rel="bookmark" title="Permanent Link: Fun With Google Code Search">Fun With Google Code&nbsp;Search</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/c8d2a_fc0QxMgEyhw" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/search-type-options-withmootools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions&#160;Friday</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/confessionsfriday/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/confessionsfriday/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:54:07 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[confessions]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[developer series]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Friday]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[web developer]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/confessionsfriday/</guid>
		<description><![CDATA[Over the past two years I&#8217;ve run my Confessions of a Web Developer series.  Each one has been really popular and well-received.  It&#8217;s Friday and I&#8217;ve had a bad week so today I want you to confess your web development sins in the comment section below.  Purge your conscious at the end of the week [...]]]></description>
			<content:encoded><![CDATA[<p><img class="image" src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/1de97_usher.jpg" alt="Confessions!" /></p>
<p>Over the past two years I&#8217;ve run my Confessions of a Web Developer series.  Each one has been really popular and well-received.  It&#8217;s Friday and I&#8217;ve had a bad week so today I want you to confess your web development sins in the comment section below.  Purge your conscious at the end of the week and confess!</p>
<p>I hope to use these for a future post so make them juicy!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4214"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/confessions-friday">Confessions&nbsp;Friday</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/confessions-iv" rel="bookmark" title="Permanent Link: Confessions of an Eccentric Web Developer IV">Confessions of an Eccentric Web Developer&nbsp;IV</a></li>
<li><a href="http://davidwalsh.name/confessions-v" rel="bookmark" title="Permanent Link: Confessions of a Web Developer V">Confessions of a Web Developer&nbsp;V</a></li>
<li><a href="http://davidwalsh.name/confessions-of-an-eccentric-web-developer" rel="bookmark" title="Permanent Link: Confessions of an Eccentric Web Developer">Confessions of an Eccentric Web&nbsp;Developer</a></li>
<li><a href="http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back" rel="bookmark" title="Permanent Link: 5 Simple Ways Programmers and Designers Should Give Back">5 Simple Ways Programmers and Designers Should Give&nbsp;Back</a></li>
<li><a href="http://davidwalsh.name/share-blog" rel="bookmark" title="Permanent Link: Share Your Blog!">Share Your&nbsp;Blog!</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/bdf48_DGDmU6xnVtg" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/confessionsfriday/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fix WordPress CRONs on Media Temple (dv)&#160;Servers</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fix-wordpress-crons-on-media-temple-dvservers/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fix-wordpress-crons-on-media-temple-dvservers/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 14:18:03 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[CRON]]></category>
		<category><![CDATA[cron jobs]]></category>
		<category><![CDATA[CRONs]]></category>
		<category><![CDATA[database backups]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[fake ip]]></category>
		<category><![CDATA[hell of a time]]></category>
		<category><![CDATA[Media]]></category>
		<category><![CDATA[Per]]></category>
		<category><![CDATA[Temple]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fix-wordpress-crons-on-media-temple-dvservers/</guid>
		<description><![CDATA[When I switched from Dreamhost shared hosting to Media Temple (dv) server hosting, I had a hell of a time trying to figure out why CRONs weren&#8217;t working correctly on the website. I had database backups being sent via CRON jobs so making sure CRONs were working was imperative. What&#8217;s great is that the way [...]]]></description>
			<content:encoded><![CDATA[<p>When I switched from Dreamhost shared hosting to Media Temple (dv) server hosting, I had a hell of a time trying to figure out why CRONs weren&#8217;t working correctly on the website.  I had database backups being sent via CRON jobs so making sure CRONs were working was imperative.  What&#8217;s great is that the way to make these WordPress CRONs work was by&#8230;setting up a CRON.</p>
<p>
To get things working, you should:</p>
<ol>
<li>Log into your Media Temple (dv) control panel.</li>
<li>Navigate to the domain and click the &#8220;Crontab&#8221; icon.</li>
<li>Click &#8220;Schedule a Task&#8221;</li>
<li>Configure the time and frequency of the CRON to any way you&#8217;d like.</li>
<li><strong>Set the &#8220;command&#8221; value to:</strong>
<pre>wget http://12.23.56.78/wp-cron.php</pre>
</li>
<li>Replace the fake IP in the command above with the IP address of your website.</li>
</ol>
<p>That&#8217;s all!  Hitting the <span>wp-cron.php</span> file with the CRON will ensure you database backups and other scheduled tasks will run at proper intervals!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4125"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/wordpress-crons">Fix WordPress CRONs on Media Temple (dv)&nbsp;Servers</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/combine-css-media-styles-file" rel="bookmark" title="Permanent Link: Combine Your CSS Media Styles Into One File">Combine Your CSS Media Styles Into One&nbsp;File</a></li>
<li><a href="http://davidwalsh.name/rules-audio-video-media" rel="bookmark" title="Permanent Link: 5 Rules For Using Audio/Video Media on Your Site">5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li>
<li><a href="http://davidwalsh.name/mootools-style-media" rel="bookmark" title="Permanent Link: MooTools: Set Style Per Media">MooTools: Set Style Per&nbsp;Media</a></li>
<li><a href="http://davidwalsh.name/php-wordpress-post-categories" rel="bookmark" title="Permanent Link: PHP: Get WordPress Post Categories">PHP: Get WordPress Post&nbsp;Categories</a></li>
<li><a href="http://davidwalsh.name/track-file-downloads-google-analytics-mootools" rel="bookmark" title="Permanent Link: Track File Downloads in Google Analytics Using MooTools">Track File Downloads in Google Analytics Using&nbsp;MooTools</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/bbfe8_ZsGzwMU7mkw" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fix-wordpress-crons-on-media-temple-dvservers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Webmasters&#160;Attack!</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/when-webmastersattack/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/when-webmastersattack/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 03:09:04 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Chris]]></category>
		<category><![CDATA[Chris Coyier]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Kitty]]></category>
		<category><![CDATA[one giant]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[png image]]></category>
		<category><![CDATA[proper programming]]></category>
		<category><![CDATA[subjective description]]></category>
		<category><![CDATA[waste bandwidth]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/when-webmastersattack/</guid>
		<description><![CDATA[CSS-Tricks scribe Chris Coyier wrote a great post titled What Beautiful HTML Code Looks Like where he outlined (with a great image, no less) how a great HTML/PHP file looks when proper programming practices are used. The post was so popular that the featured image was promoted to the Digg homepage. Then the webmasters logged [...]]]></description>
			<content:encoded><![CDATA[<p>CSS-Tricks scribe Chris Coyier wrote a great post titled <a href="http://css-tricks.com/what-beautiful-html-code-looks-like/">What Beautiful HTML Code Looks Like</a> where he outlined (with a great image, no less) how a great HTML/PHP file looks when proper programming practices are used.  The post was so popular that the featured image was promoted to the Digg homepage.  Then the webmasters logged out of their guild chat long enough to <a href="http://digg.com/design/What_Beautiful_HTML_Code_Looks_Like_inforgraphic">bless the Digg comments with their wisdom</a>.  I present to you&#8230;</p>
<h2>When Webmasters Attack!</h2>
<blockquote><p>Also, what kind of web designer doesn&#8217;t already know this? It&#8217;s called being organized. However, all that white-space is going to add-up and waste bandwidth, which makes this &#8220;beautiful code&#8221; (a self-serving, inaccurate, subjective description) not-so-perfect.</p></blockquote>
<p>What kind of web designer doesn&#8217;t know how easy it is to GZIP content which compresses/eliminates all of the extra whitespace that makes code more maintainable?</p>
<blockquote><p>I don&#8217;t think &lt;?php .. is valid HTML 5 either.</p></blockquote>
<p>This isn&#8217;t a &#8220;Hello Kitty&#8221; picture, Webmaster, so please don&#8217;t comment.  This will get parsed by PHP and output as HTML.</p>
<blockquote><p>I link to one stylesheet. It works on firefox, safari and ie8.<br />
<Br /><br />
If you can&#8217;t be bothered to upgrade your browser, I can&#8217;t be bothered with you.<br />
<Br /><br />
None of this If IE&gt;blabla shit.<br />
<Br /><br />
Oh, and spare me the &#8220;but i need IE6 to use some of the software at my office&#8221;. I DONT CARE! Use a more recent browser to surf the internet, and stop spreading viruses because you&#8217;re too lazy.</p></blockquote>
<p>I was going to ask you, Webmaster, about your clients&#8217; web visitors and the money they&#8217;d be losing by turning away persons with IE6 and IE7 browsers but then I realized I took them all from you.  Apparently the order of importance goes:  you, client, visitors.  That&#8217;s completely backward.</p>
<blockquote><p>&#8230;The irony of this article is that it&#8217;s one giant PNG image.  Further proof that the most beautiful HTML is the nonexistent kind.</p></blockquote>
<p>Apparently Chris should have used a JPEG?</p>
<blockquote><p>Why I am not surprised to see a MacOS window?</p></blockquote>
<p>Because you&#8217;re a psychic?  WTF is that supposed to mean?</p>
<blockquote><p>PHP in a .HTML file?<br />
<Br /><br />
change the title to &#8220;What Beautiful HTML Code Looks Like [infoFAIL]&#8220;</p></blockquote>
<p>As long as you&#8217;re going to ignore the main point of the post and be a smart ass about the PHP/HTML, I&#8217;ll point out that Chris added a .htaccess directive to parse .html files as PHP.  Ouch, sick burn!</p>
<blockquote><p>No title attributes in the anchor tags. Since when does that make for beautiful HTML?</p></blockquote>
<p>The article isn&#8217;t called &#8220;What Beautiful SEO Looks Like&#8221;.</p>
<blockquote><p>This page has a story, a sidebar, and a footer. &#8216;Real&#8217; websites are far more dynamic than this, and by &#8216;real&#8217; I mean ones that people will go to. Complex websites have complex markup. You shouldn&#8217;t be bragging just because you&#8217;ve passed your w3schools tests.</p></blockquote>
<p>You&#8217;re right.  What he should really brag about are the dozens of thousands of RSS followers and his status within the community.</p>
<blockquote><p>I get it but to some point it gets stupid. Stop accommodating specific browsers. If the web page loads properly then good but if it doesnt and looks broken then that tells he consumer to upgrade their fucking browser! It should be that simple.</p></blockquote>
<p>Another lazy, ignorant idiot that doesn&#8217;t understand that he isn&#8217;t important &#8212; his clients and their visitors are.  This person clearly doesn&#8217;t get it.</p>
<h2>In the end&#8230;</h2>
<p>Thank you again, Webmaster, for reminding me why I should be so proud of the work I do.  Without you I couldn&#8217;t pay for house, cars, and fine wine.  Keep up the good work so I can keep up my fine life!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4177"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/when-webmasters-attack">When Webmasters&nbsp;Attack!</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/create-digg-url-php" rel="bookmark" title="Permanent Link: Create Digg URLs Using PHP">Create Digg URLs Using&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/advanced-htaccess-security-block-unwanted-referrers" rel="bookmark" title="Permanent Link: Advanced .htaccess Security – Block Unwanted Referrers">Advanced .htaccess Security &#8211; Block Unwanted&nbsp;Referrers</a></li>
<li><a href="http://davidwalsh.name/6-reason-why-digg-is-losing-me" rel="bookmark" title="Permanent Link: 6 Reason Why Digg Is Losing Me">6 Reason Why Digg Is Losing&nbsp;Me</a></li>
<li><a href="http://davidwalsh.name/msn-live-search-result-grabber" rel="bookmark" title="Permanent Link: MSN Live Search Result Grabber">MSN Live Search Result&nbsp;Grabber</a></li>
<li><a href="http://davidwalsh.name/google-spy-php-total-search-results" rel="bookmark" title="Permanent Link: Google Grabber — Using PHP to Find Out How Many Pages Your Domain Has Listed in Google">Google Grabber &#8212; Using PHP to Find Out How Many Pages Your Domain Has Listed in&nbsp;Google</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/f20b9_O7vAD1YYehY" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/when-webmastersattack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bold Web Predictions for&#160;2010</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/bold-web-predictions-for2010/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/bold-web-predictions-for2010/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 16:09:04 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[dell compaq]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Kevin Rose]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[system versions]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/bold-web-predictions-for2010/</guid>
		<description><![CDATA[With another year coming to a close, it&#8217;s time to look toward the near future. The following are my predictions for the web in 2010. Twitter will steal a bit of Google&#8217;s search thunder. Twitter challenge Google search? You bet. The advantage twitter has over Google search is that Twitter provides almost to-the-second search results [...]]]></description>
			<content:encoded><![CDATA[<p>With another year coming to a close, it&#8217;s time to look toward the near future.  The following are my predictions for the web in 2010.</p>
<h2>Twitter will steal a bit of Google&#8217;s search thunder.</h2>
<p>Twitter challenge Google search?  You bet.  The advantage twitter has over Google search is that Twitter provides almost to-the-second search results so if you want the most recent content, you can hit Twitter.  While Google analyzes static content, Twitter provides you the &#8220;buzz&#8221;, or most recently/frequently talked about links/information in a condensed format.  Sometimes fewer options and information is a good thing.</p>
<h2>Gmail and GChat will slowly become Google Wave.</h2>
<p>Wave is clearly Google&#8217;s successor to vanilla email (via Gmail) and instant messaging.  Don&#8217;t look for Gmail to disappear completely during 2010 but I expect Wave to completely integrate email capabilities by the end of 2010.</p>
<h2>Facebook will grow in popularity despite continuing to disappointing its own users;  Your mother will join Facebook.<br />
</h2>
<p>Unfortunately Facebook will continue to add features that make their site more difficult to use and, in doing so, will continue to disregard the fury of its users.  Facebook will continue to &#8220;out-think the room&#8221; in the features it adds.  Facebook will also push its &#8220;Lite&#8221; version more toward an older audience.  Your mother, in turn, will join.  MySpace will continue to become the Geocities of social websites.</p>
<h2>Internet Explorer 6 support will finally be dropped from 90+% of websites.</h2>
<p>Many websites have already dropped IE6 support, which I feel is too soon, but we should all be able to rejoice by the end of 2010.  Windows 7 will have been out for over a year and IT departments will be pushed into upgrading from XP so as to not allow employees to be two operating system versions behind.  Persons with older PCs will also opt to upgrade to a newer system due to highly competitive pricing by Dell, Compaq, and Toshiba.</p>
<h2>Webkit-based browsers will overtake Firefox;  Mozilla will face a Web Designer/Developer rebellion.</h2>
<p>Google Chrome has quickly become a developer favorite during 2009 and there&#8217;s no reason to believe that affection will slow during 2010.  Expect Chrome to debut a flexible plugin system during 2010 which will meet or exceed the flexibility provided by Firefox.  As a result of Firebug&#8217;s bugs and memory problems, Mozilla will start to draw the ire of the developers that made them so popular.</p>
<h2>Windows 7 will be a giant success (on a Windows level).</h2>
<p>Due to the garbage OS known as Vista and continued successful marketing by Microsoft, Windows 7 will become a huge success.  Lets not discount the improvements made by Windows 7 though &#8212; its UI and functionality improvements are to be recognized.  IT departments will most definitely be pushed to update their outdated XP machines, begrudgingly or not.  Mac fanboys wont notice a thing.</p>
<h2>The MooTools javascript framework will boom in popularity thanks to the plugin forge and MooTools 2.</h2>
<p>Having a central repository for quality MooTools plugins will increase the usage of the javascript framework.  MooTools 2, with its improvements in every piece of the framework, will turn the heads of developers using other libraries.  I also foresee users of other frameworks, looking for a more advanced OOP approach, giving MooTools a solid shot.</p>
<h2>Digg will completely lose its developer/designer userbase and become &#8220;just another funny pics/vids&#8221; site.</h2>
<p>Diggers&#8217; habits of promoting stupid pictures and videos will essentially ruin that last shreds of credibility the site has left and users will continue to leave.  Kevin Rose will take &#8220;less of a role&#8221; with Digg in an effort to distance himself from Digg&#8217;s direction.</p>
<h2>The David Walsh Blog will continue to ascend.<br />
</h2>
<p>More sweet MooTools, jQuery, CSS, PHP, and AJAX tutorials on the way&#8230;but then again, you already knew this.</p>
<p>What do you think?  Am I crazy?  Are these easy predictions?  Tell me!</p>
<div>
                                <a href="http://davidwalsh.name/wp-content/plugins/as-pdf/generate.php?post=4092"><br />
                                    <span>Download PDF</span><br />
                                </a>
                            </div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/predictions-2010">Bold Web Predictions for&nbsp;2010</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/tweetify" rel="bookmark" title="Permanent Link: Implementing String.Tweetify in MooTools">Implementing String.Tweetify in&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/follow-mootools-twitter" rel="bookmark" title="Permanent Link: Following MooTools on Twitter">Following MooTools on&nbsp;Twitter</a></li>
<li><a href="http://davidwalsh.name/web-predictions-2009" rel="bookmark" title="Permanent Link: Web Predictions For 2009">Web Predictions For&nbsp;2009</a></li>
<li><a href="http://davidwalsh.name/twitter-charge" rel="bookmark" title="Permanent Link: What If:  Twitter Started Charging $5/Month">What If:  Twitter Started Charging&nbsp;$5/Month</a></li>
<li><a href="http://davidwalsh.name/load-static-content-dynamic" rel="bookmark" title="Permanent Link: Load Your Static Content the Dynamic Way">Load Your Static Content the Dynamic&nbsp;Way</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/fe66d_mUoQejFFtws" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/bold-web-predictions-for2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing mod_rewrite and .htaccess on GoDaddy&#160;Hosting</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fixing-mod_rewrite-and-htaccess-on-godaddyhosting/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fixing-mod_rewrite-and-htaccess-on-godaddyhosting/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 16:27:05 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[GoDaddy]]></category>
		<category><![CDATA[hotlinking]]></category>
		<category><![CDATA[Mod]]></category>
		<category><![CDATA[rewriterule]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[URLs]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fixing-mod_rewrite-and-htaccess-on-godaddyhosting/</guid>
		<description><![CDATA[I recently launched a new website on GoDaddy shared hosting. The website required mod_rewrite for SEO-friendly URLs. GoDaddy provides mod_rewrite but every time I tried to hit a two-deep URL, I would get a 404 error. Here&#8217;s what I had: # Mod Rewrite Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d [...]]]></description>
			<content:encoded><![CDATA[<p>I recently launched a new website on GoDaddy shared hosting.  The website required mod_rewrite for SEO-friendly URLs.  GoDaddy provides mod_rewrite but every time I tried to hit a two-deep URL, I would get a 404 error.  Here&#8217;s what I had:</p>
<pre># Mod Rewrite
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</pre>
<p>The fix to this problem was to add the following directive before my mod_rewrite directives:</p>
<pre>#Fix Rewrite
Options -Multiviews</pre>
<p>Tada!  The URLs began working and the website&#8217;s SEO has taken off!</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/mod_rewrite-htaccess-godaddy">Fixing mod_rewrite and .htaccess on GoDaddy&nbsp;Hosting</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/check-module-presence-htaccess" rel="bookmark" title="Permanent Link: Check For Module Presence in .htaccess">Check For Module Presence in&nbsp;.htaccess</a></li>
<li><a href="http://davidwalsh.name/wordpress-htaccess-file-is-genius" rel="bookmark" title="Permanent Link: WordPress’ .htaccess File Is Genius">WordPress&#8217; .htaccess File Is&nbsp;Genius</a></li>
<li><a href="http://davidwalsh.name/prevent-image-hotlinking" rel="bookmark" title="Permanent Link: Prevent Image Hotlinking With .htaccess and mod_rewrite">Prevent Image Hotlinking With .htaccess and&nbsp;mod_rewrite</a></li>
<li><a href="http://davidwalsh.name/godaddy-hosting-curl" rel="bookmark" title="Permanent Link: GoDaddy Hosting Tip – Using CURL On GoDaddy Shared Hosting">GoDaddy Hosting Tip &#8211; Using CURL On GoDaddy Shared&nbsp;Hosting</a></li>
<li><a href="http://davidwalsh.name/no-www-using-htaccess-file" rel="bookmark" title="Permanent Link: No WWW Using .htaccess">No WWW Using&nbsp;.htaccess</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/42d5e_tQrBnQc7cWE" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fixing-mod_rewrite-and-htaccess-on-godaddyhosting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New York Times-Style Text Selection Widget Using MooTools or&#160;jQuery</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-orjquery/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-orjquery/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:20:14 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Aaron Newton]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[mysql optimization]]></category>
		<category><![CDATA[New York]]></category>
		<category><![CDATA[new york time]]></category>
		<category><![CDATA[security shell]]></category>
		<category><![CDATA[selection]]></category>
		<category><![CDATA[selection createrange]]></category>
		<category><![CDATA[selectionImage]]></category>
		<category><![CDATA[shell theory]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-orjquery/</guid>
		<description><![CDATA[Aaron Newton made a great request to me last week: why not make my MooTools Documentation Bookmarklet function more like the New York Time&#8217;s text selection widget. NYT&#8217;s text selection widget listens for text selection and presents the user with a &#8220;search&#8221; icon they may click on to learn more about that term. I&#8217;ve tried [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/ac3de_nytimeswidget.jpg" alt="NY Times Widget" />
</p>
<p>Aaron Newton made a great request to me last week:  why not make my <a href="http://davidwalsh.name/mootools-documentation">MooTools Documentation Bookmarklet</a> function more like the New York Time&#8217;s text selection widget.  NYT&#8217;s text selection widget listens for text selection and presents the user with a &#8220;search&#8221; icon they may click on to learn more about that term.  I&#8217;ve tried to answer that challenge &#8212; not in bookmarklet form but in website widget form.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/selection-search.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/selection-search.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<h2>The Sample HTML</h2>
<pre>
&lt;div id=&quot;content-area&quot;&gt;
	.htaccess AJAX Apache / Server APIs Blog Bookmarking / Social Books Browsers CSS / Design Google Guest Blogger Hosting / Domain Javascript jQuery
	link() Microsoft MooTools MySQL Optimization PHP Poll rand() Security Shell Theory / Ideas Usability / Accessibility XML / XHTML
	This blog is targeted toward all levels of web designers and developers. All web topics are discussed, including CSS, Javascript (MooTools and jQuery), PHP, and more.
&lt;/div&gt;
</pre>
<p>The above code is next to meaningless per the widget &#8212; I simply want to illustrate the area I&#8217;d like it to work in has an ID of <span>content-area</span>.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function(){
	(function($) {
		//gets the selected text
		var getSelection = function() {
			return $try(
				function() { return window.getSelection(); },
				function() { return document.getSelection(); },
				function() {
			        var selection = document.selection &amp;&amp; document.selection.createRange();
					if(selection.text) { return selection.text; }
					return false;
			      }
			) || false;
		};
		//vars
		var url = 'http://davidwalsh.name/?s={term}', selectionImage;
		//event to listen
		$('content-area').addEvent('mouseup',function(e) {
			var selection = getSelection();
			if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
				//ajax here { http://davidwalsh.name/text-selection-ajax }
				if(!selectionImage) {
					selectionImage = new Element('a',{
						href: url,
						opacity:0,
						id: 'selection-image',
						title: 'Click here to learn more about this term',
						target: '_blank',
						fade: { duration:50 }
					}).inject(document.body,'top');
				}
				//handle the every-time event
				//alert(selection);
				selectionImage.set('href',url.replace('{term}',encodeURI(selection))).setStyles({
					top: e.page.y - 30,	//offsets
					left: e.page.x - 13 //offsets
				}).fade('in');
			}
		});

		$(document.body).addEvent('mousedown',function() {
			//hider
			if(selectionImage) { selectionImage.fade('out'); }
		});

	})(document.id);
});
</pre>
<p>During the <span>mouseup</span> event within the selected container (<span>content-area</span>), we determine if any text has been highlighted.  If so, we:</p>
<ol>
<li>Insert the <span>A</span> element if it has not yet been injected into the body.</li>
<li>Change the <span>A</span> element&#8217;s URL to accommodate for the new search term.</li>
<li>Position the element to at an offset position above where the mouse goes up.</li>
</ol>
<p>During every <span>mousedown</span> event we hide the <span>A</span> element.</p>
<h2>The jQuery Javascript</h2>
<pre>
/* attempt to find a text selection */
function getSelected() {
	if(window.getSelection) { return window.getSelection(); }
	else if(document.getSelection) { return document.getSelection(); }
	else {
		var selection = document.selection &amp;&amp; document.selection.createRange();
		if(selection.text) { return selection.text; }
		return false;
	}
	return false;
}
/* create sniffer */
$(document).ready(function() {
	var url = 'http://davidwalsh.name/?s={term}', selectionImage;
	$('#content-area').mouseup(function(e) {
		var selection = getSelected();
		if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
			//ajax here { http://davidwalsh.name/text-selection-ajax }
			if(!selectionImage) {
				selectionImage = $('&lt;a&gt;').attr({
					href: url,
					title: 'Click here to learn more about this term',
					target: '_blank',
					id: 'selection-image'
				}).hide();
				$(document.body).append(selectionImage);
			}
			selectionImage.attr('href',url.replace('{term}',encodeURI(selection))).css({
				top: e.pageY - 30,	//offsets
				left: e.pageX - 13 //offsets
			}).fadeIn();
		}
	});
	$(document.body).mousedown(function() {
		if(selectionImage) { selectionImage.fadeOut(); }
	});
});
</pre>
<p>Follows the same principal as above.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/selection-search.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/selection-search.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<h2>Ideas &amp; Enhancements</h2>
<ul>
<li>Depending on your philosophy, you may want to implement a minimum character check as well:</p>
<pre>
if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,'')) &amp;&amp; selection.length &gt; 4) { //5 char min
</pre>
</li>
<li>You may want to also fidget with adding/modifying text selection with keyboard keys as well.  I&#8217;ve chosen to pass on that.</li>
<li><a href="http://davidwalsh.name/text-selection-ajax">Saving the selection content via AJAX</a> for analytical reasons may not be a bad idea either.</li>
</ul>
<p>Have any other ideas for improvement?  Would you have any use for this on your website(s)?</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/text-select-widget">New York Times-Style Text Selection Widget Using MooTools or&nbsp;jQuery</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/text-selection-ajax" rel="bookmark" title="Permanent Link: Record Text Selections Using MooTools or jQuery AJAX">Record Text Selections Using MooTools or jQuery&nbsp;AJAX</a></li>
<li><a href="http://davidwalsh.name/csstricks-css-text-selection-highlighting" rel="bookmark" title="Permanent Link: CSS-Tricks — CSS &amp; Text Selection &amp; Highlighting">CSS-Tricks &#8212; CSS &#38; Text Selection &#38;&nbsp;Highlighting</a></li>
<li><a href="http://davidwalsh.name/script-style-favelet" rel="bookmark" title="Permanent Link: Script &amp; Style Revamp with Submission Favelet">Script &#38; Style Revamp with Submission&nbsp;Favelet</a></li>
<li><a href="http://davidwalsh.name/digg-share-widget" rel="bookmark" title="Permanent Link: Digg-Style Dynamic Share Widget Using MooTools">Digg-Style Dynamic Share Widget Using&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/load-more-widget" rel="bookmark" title="Permanent Link: David Walsh on NetTuts:  Create a Twitter-Like “Load More” Widget">David Walsh on NetTuts:  Create a Twitter-Like “Load More”&nbsp;Widget</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/ac3de_mpq-5qKrGKE" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-orjquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Record Text Selections Using MooTools or jQuery&#160;AJAX</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jqueryajax/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jqueryajax/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:18:57 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[document selection]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[javascript library]]></category>
		<category><![CDATA[Return]]></category>
		<category><![CDATA[return document]]></category>
		<category><![CDATA[selection]]></category>
		<category><![CDATA[selection createrange]]></category>
		<category><![CDATA[selection function]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jqueryajax/</guid>
		<description><![CDATA[One technique I&#8217;m seeing more and more these days (CNNSI.com, for example) is AJAX recording of selected text. It makes sense &#8212; if you detect users selecting the terms over and over again, you can probably assume your visitors are searching that term on Google, Yahoo, etc. I&#8217;ve duplicated this functionality using my favorite javascript [...]]]></description>
			<content:encoded><![CDATA[<p>One technique I&#8217;m seeing more and more these days (CNNSI.com, for example) is AJAX recording of selected text.  It makes sense &#8212; if you detect users selecting the terms over and over again, you can probably assume your visitors are searching that term on Google, Yahoo, etc.  I&#8217;ve duplicated this functionality using my favorite javascript library, MooTools, and another javascript library, jQuery.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function(){
	//gets the selected text
	var getSelection = function() {
		return $try(
			function() { return window.getSelection(); },
			function() { return document.getSelection(); },
			function() {
					var selection = document.selection &#38;&#38; document.selection.createRange();
					if(selection.text) { return selection.text; }
					return false;
		      }
		) || false;
	};
	//event to listen
	var selectRequest = new Request({
		url: 'ajax-selection-copy.php',
		method: 'post'
	});
	$('content-area').addEvent('mouseup',function(e) {
		var selection = getSelection();
		if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
			selectRequest.send('selection=' + encodeURI(selection));
		}
	});
});
</pre>
<p>The first step is attempting to grab the selected text during the <span>mouseup</span> within our designated container.  If we find a text selection we fire an AJAX request to a PHP script which will save the text selection.</p>
<h2>The jQuery Javascript</h2>
<pre>
/* attempt to find a text selection */
function getSelected() {
	if(window.getSelection) { return window.getSelection(); }
	else if(document.getSelection) { return document.getSelection(); }
	else {
		var selection = document.selection &#38;&#38; document.selection.createRange();
		if(selection.text) { return selection.text; }
		return false;
	}
	return false;
}
/* create sniffer */
$(document).ready(function() {
	$('#content-area').mouseup(function() {
		var selection = getSelected();
		if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
			$.ajax({
				type: 'post',
				url: 'ajax-selection-copy.php',
				data: 'selection=' + encodeURI(selection)
			});
		}
	});
});
</pre>
<p>The MooTools code translated to jQuery.</p>
<h2>The PHP</h2>
<pre>
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' &amp;&amp; $selection = trim($_POST['selection'])) {
	mysql_query('INSERT INTO text_selections (selection,date_selected) VALUES(\''.mysql_escape_string(stripslashes($selection)).'\',NOW())');
}
</pre>
<p>The above PHP code is very primitive.  Depending on the setup of your system (PHP Framework, security settings, etc.) you will want to implement additional measures to prevent attacks on this script.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<p>Recording text selections is a great way to discover what topics and/or terms your audience is interested in.  You may also want to provide more information on these terms within posts.</p>
<p>What are your thoughts on this?  Do you think this is too much like <a href="http://davidwalsh.name/ajax-evil-spyjax">Spyjax</a>?  Perfectly OK?</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/text-selection-ajax">Record Text Selections Using MooTools or jQuery&nbsp;AJAX</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/jquery-favelet-documentation" rel="bookmark" title="Permanent Link: jQuery Code Documentation Favelet">jQuery Code Documentation&nbsp;Favelet</a></li>
<li><a href="http://davidwalsh.name/animated-ajax-jquery" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using jQuery">Animated Ajax Record Deletion Using&nbsp;jQuery</a></li>
<li><a href="http://davidwalsh.name/mootools-documentation" rel="bookmark" title="Permanent Link: MooTools Documentation Search Favelet">MooTools Documentation Search&nbsp;Favelet</a></li>
<li><a href="http://davidwalsh.name/animated-ajax-record-deletion-mootools" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using MooTools">Animated Ajax Record Deletion Using&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/broken-images-jquery-ajax" rel="bookmark" title="Permanent Link: Send Email Notifications for Broken Images Using jQuery Ajax">Send Email Notifications for Broken Images Using jQuery&nbsp;Ajax</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/1b1c3_czUFGTW9u7w" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jqueryajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Open Letter to You, Webmaster&#160;II</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmasterii/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmasterii/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:18:06 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[advanced javascript]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[client websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[David WalshSenior]]></category>
		<category><![CDATA[extra hour]]></category>
		<category><![CDATA[I.  I]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[meta keywords]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmasterii/</guid>
		<description><![CDATA[Dear Webmaster, It&#8217;s been over a year since I last wrote. Business is booming for me which reminded me to get in touch with you again. I&#8217;m shocked at the advancements you&#8217;ve made! Wow &#8212; you&#8217;ve gotten acquainted with javascript frameworks! In fact, it appears you&#8217;ve gotten so good with the popular javascript frameworks that [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/80a43_webmastador.jpg" alt="Webmaster" /></p>
<p>Dear Webmaster,</p>
<p>It&#8217;s been over a year <a href="http://davidwalsh.name/open-letter-webmaster">since I last wrote</a>. Business is booming for me which reminded me to get in touch with you again.  I&#8217;m shocked at the advancements you&#8217;ve made!</p>
<p>Wow &#8212; you&#8217;ve gotten acquainted with javascript frameworks!  In fact, it appears you&#8217;ve gotten so good with the popular javascript frameworks that you&#8217;re using multiple in each of your client websites.  I see jQuery, MooTools, and Dojo in the same page!  Good idea &#8212; the more frameworks you add to the page, the more plugins you can add without needing to code any javascript yourself.  Well thought-out.  I also see that you&#8217;re adding javascript frameworks for simple getElementById() selection &#8212; why not?  I&#8217;m sure you&#8217;ll use more advanced javascript on your client&#8217;s website at some point, so best to include the libraries now.</p>
<p>I also noticed that you&#8217;ve completely dropped support of Internet Explorer 6.  My favorite touch is the &#8220;upgrade your browser&#8221; message you&#8217;ve added to your client websites, no doubt without their permission.  I admire your resolve &#8212; why should you go through the hassle of spending an extra hour to make your site work in IE6?  Let the visitor suffer and the client lose business &#8212; you don&#8217;t need the headache of dealing with IE6.  Another intelligent philosophy.</p>
<p>You&#8217;ve obviously taken a search engine optimization class because I can see loads of keywords in every sentence within the content area.  Writing content for the user is overrated &#8212; writing content for Google?  Brilliant!  Who cares if the sentences are so bloated the visitor can&#8217;t read them;  they wouldn&#8217;t have gotten to the client&#8217;s website without Google!  And I see that despite no search engines still supporting meta keywords, you&#8217;re still selling them.  The client doesn&#8217;t know any better so we&#8217;ll keep that between you and I.  I also see that your page file names are stuff with 5-10 keywords&#8230;genius!  Those will most definitely rank highly!</p>
<p>I see you&#8217;ve chosen to keep your CSS verbose.  Shorthand CSS is clearly a fad that you aren&#8217;t going to get tricked into &#8212; clever thinking!  Of course shorthand CSS is less code but hell, there&#8217;s a lot to remember when you use shorthand CSS!  And using text-transform to capitalize letters?  Please!  Why use CSS when you can simply capitalize verbiage with PHP&#8217;s or easier yet, type in the text with caps-lock cemented down?</p>
<p>You&#8217;ve added your personal Twitter feed to your own website &#8212; great!  Sure you often cuss in your tweets and post links to inappropriate media but you SOMETIMES post web-relevant tweets which will help you gain clients.  What&#8217;s also impressive is that you&#8217;ve implemented Google Adsense on your website &#8212; extra income FTW!  Who cares if ads for other web design agencies are shown?  They already on your website so they&#8217;ve found their desired vendor &#8212; you!</p>
<p>Your website also states that you offer no phone support, only email support within limited hours per day.  Now that&#8217;s an idea based on convenience&#8230;not for the customer, but for you.  An overwhelming theme with your services.  And I understand completely &#8212; you have a busy life!  It&#8217;s not fair that a client call and interrupt anything you&#8217;re doing.</p>
<p>As always Webmaster, I appreciate what you do.  A respected Senior Web Developer like myself cannot put food on the table without help from people like you.  You&#8217;re a dying breed, Webmaster.  Stay strong my friend &#8212; serious Web Developers like me need you out there.</p>
<p>Sincerely,</p>
<p>David Walsh<br />Senior Web Developer</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/open-letter-webmaster-ii">An Open Letter to You, Webmaster&nbsp;II</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/open-letter-webmaster" rel="bookmark" title="Permanent Link: An Open Letter to You, Webmaster">An Open Letter to You,&nbsp;Webmaster</a></li>
<li><a href="http://davidwalsh.name/website-tools-alexa-rank-css-xhtml-javascript-compressor" rel="bookmark" title="Permanent Link: My Website Tools">My Website&nbsp;Tools</a></li>
<li><a href="http://davidwalsh.name/does-open-source-mean-you-cant-bitch" rel="bookmark" title="Permanent Link: Does Open Source Mean You Can’t Bitch?">Does Open Source Mean You Can&#8217;t&nbsp;Bitch?</a></li>
<li><a href="http://davidwalsh.name/google-password-protected-areas" rel="bookmark" title="Permanent Link: Allow Google Into Password Protected Areas">Allow Google Into Password Protected&nbsp;Areas</a></li>
<li><a href="http://davidwalsh.name/google-reader-hath-thou-forsaken" rel="bookmark" title="Permanent Link: Google Reader, Why Hath Thou Forsaken Me?">Google Reader, Why Hath Thou Forsaken&nbsp;Me?</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/80a43_XL83_qVJ7Mc" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmasterii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rounded Corners in Internet&#160;Explorer</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internetexplorer/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internetexplorer/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:15:22 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[code fixes]]></category>
		<category><![CDATA[corner elements]]></category>
		<category><![CDATA[CurvyCorners]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Explorer]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[internet explorer cannot open the internet site]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internetexplorer/</guid>
		<description><![CDATA[One of the reasons that I love Firefox and Webkit-based browsers (Chrome, Safari) is the ability to effortlessly create rounded-corner elements using pure CSS: .round { -moz-border-radius:12px; -webkit-border-radius:12px; } As you probably already know, IE doesn&#8217;t allow you to create rounded corners without using images or endless hacking. Enter the CurvyCorners javascript project. CurvyCorners allows [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwalsh.name/dw-content/curvy-corners.php"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/8d493_roundedcorners.png" alt="Rounded Corners" /></a></p>
<p>One of the reasons that I love Firefox and Webkit-based browsers (Chrome, Safari) is the ability to effortlessly create rounded-corner elements using pure CSS:</p>
<pre>
.round	{ -moz-border-radius:12px; -webkit-border-radius:12px; }
</pre>
<p>As you probably already know, IE doesn&#8217;t allow you to create rounded corners without using images or endless hacking.  Enter the <a href="http://code.google.com/p/curvycorners">CurvyCorners javascript project</a>.  CurvyCorners allows you to quickly create rounded corners within Internet Explorer.</p>
<div><a href="http://davidwalsh.name/dw-content/curvy-corners.php">View Demo</a>
<div></div>
</div>
<h2>The CurvyCorners Javascript</h2>
<pre>
&lt;!-- SIMPLY INCLUDE THE JS FILE! --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;curvy.corners.trunk.js&quot;&gt;&lt;/script&gt;
</pre>
<p>CurvyCorners detects the usage of &#8220;-webkit-border-radius&#8221; and &#8220;moz-border-radius&#8221; on DOM elements and works its magic to duplicate the effect in IE using a series of small DIVs.  There are no images involved.  You may also identify specific elements to apply rounded corners to:</p>
<pre>
var settings = {
			tl: { radius: 12 },
			tr: { radius: 12 },
			bl: { radius: 12 },
			br: { radius: 12 },
			antiAlias: true
		 };
/* moooo */
$$('.round').each(function(rd) {
	curvyCorners(settings,rd);
});
</pre>
<h2>MooTools  + Curvy Corners</h2>
<p>CurvyCorners is known to brick your MooTools code.  The <a href="http://code.google.com/p/curvycorners/source/browse/#svn/trunk/examples">trunk code</a> fixes those issues.</p>
<div><a href="http://davidwalsh.name/dw-content/curvy-corners.php">View Demo</a>
<div></div>
</div>
<p>Don&#8217;t let Internet Explorer&#8217;s refusal to implement rounded corners via CSS keep your websites from being as dynamic as possible!  CurvyCorners helps make rounded corners in IE possible!</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/rounded-corners-ie">Rounded Corners in Internet&nbsp;Explorer</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/rounded-corners-webkit" rel="bookmark" title="Permanent Link: Rounded Corners in Webkit">Rounded Corners in&nbsp;Webkit</a></li>
<li><a href="http://davidwalsh.name/rounded-corners-firefox" rel="bookmark" title="Permanent Link: Rounded Corners in Mozilla Firefox">Rounded Corners in Mozilla&nbsp;Firefox</a></li>
<li><a href="http://davidwalsh.name/internet-explorer-cannot-open-internet-site" rel="bookmark" title="Permanent Link: IE Says “Internet Explorer cannot open the Internet Site ________. Operation Aborted.”  I Say “WTF?”">IE Says &#8220;Internet Explorer cannot open the Internet Site ________. Operation Aborted.&#8221;  I Say&nbsp;&#8220;WTF?&#8221;</a></li>
<li><a href="http://davidwalsh.name/chrome-frame" rel="bookmark" title="Permanent Link: Turn Internet Explorer into Chrome with Chrome Frame">Turn Internet Explorer into Chrome with Chrome&nbsp;Frame</a></li>
<li><a href="http://davidwalsh.name/css-image-filters-internet-explorer" rel="bookmark" title="Permanent Link: CSS Image Filters in Internet Explorer">CSS Image Filters in Internet&nbsp;Explorer</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/da9c8_v1K6ovbX1-U" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internetexplorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Event Delegation with&#160;MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-withmootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-withmootools/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:14:19 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Delegation]]></category>
		<category><![CDATA[document id]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[new element]]></category>
		<category><![CDATA[sample html]]></category>
		<category><![CDATA[syntax window]]></category>
		<category><![CDATA[Walsh Blog]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-withmootools/</guid>
		<description><![CDATA[Events play a huge role in javascript. I can&#8217;t name one website I&#8217;ve created in the past two years that hasn&#8217;t used javascript event handling on some level. Ask yourself: how often do I inject elements into the DOM and not add an event to them? For me it&#8217;s very rare. For this reason I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Events play a huge role in javascript.  I can&#8217;t name one website I&#8217;ve created in the past two years that hasn&#8217;t used javascript event handling on some level.  Ask yourself:  how often do I inject elements into the DOM and not add an event to them?  For me it&#8217;s very rare.  For this reason I&#8217;m proud and excited for the release of <a href="http://mootools.net/docs/more/Element/Element.Delegation">MooTools 1.2.4&#8217;s Event.Delegation</a> code.</p>
<h2>WTF is Event Delegation?</h2>
<p>Event delegation is the process of assigning an event listener to a parent for all of its children instead of assigning the same event to every child.</p>
<div><a href="http://davidwalsh.name/dw-content/event-delegation.php">View Demo</a>
<div></div>
</div>
<h2>Some Sample HTML</h2>
<pre>
&lt;ul id=&quot;link-list&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name&quot;&gt;David Walsh Blog Link 1&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name&quot;&gt;David Walsh Blog Link 2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name&quot;&gt;David Walsh Blog Link 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>A list with 3 list item elements which contain a link.  For the sake of my example, this list will have list items added to it and we want an alert to pop up any time a link within the list is clicked.</p>
<h2>The MooTools Javascript Event Delegation Syntax</h2>
<pre>
window.addEvent('domready',function() {
	/* delegate */
	document.id('link-list').addEvent('click:relay(a)', function(e){
		e.stop();
		alert('you clicked a link!');
	});
	/*
		Add link to show event delegation works!
		Notice how we haven't assigned an event to this specific element.
		We already added the event to the list element itself
	*/
	document.id('add-link').addEvent('click',function() {
		var li = new Element('li').inject('link-list');
		var link = new Element('a',{ text:'David Walsh Blog', href:'http://davidwalsh.name'}).inject(li);
	});
});
</pre>
<p>All you need to do is add <span>:relay</span> to the parent selector and place the &#8220;children&#8221; match inside the relay pseudo selector.  You&#8217;ll probably question how <span>:relay</span> works because the &#8220;:&#8221; syntax is used for pseudo selectors.  The Element.Delegation javascript download overwrites the addEvent, removeEvent, and fireEvent methods to accommodate for the <span>:relay</span> syntax.</p>
<h2>Event Delegation Replaces&#8230;</h2>
<pre>
var links = document.id('link-list').getElements('li');
links.each(function(link) {
	link.addEvent('click',function() {
		//assign actions here
	});
})
</pre>
<p>Why collect and iterate through elements to add events when you can simply use event delegation?</p>
<div><a href="http://davidwalsh.name/dw-content/event-delegation.php">View Demo</a>
<div></div>
</div>
<p>Event delegation is a great way to avoid repeating the same event assignments for elements within a parent element, especially when you are adding elements into the page dynamically.  If you&#8217;ve not upgraded to MooTools 1.2.4 yet, I hope this is just the kick in the pants you need!</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/event-delegation">Event Delegation with&nbsp;MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-event-delegation" rel="bookmark" title="Permanent Link: MooTools Event Delegation">MooTools Event&nbsp;Delegation</a></li>
<li><a href="http://davidwalsh.name/prevent-default-event-actions-mootools-12" rel="bookmark" title="Permanent Link: Prevent Default Event Actions Using MooTools 1.2">Prevent Default Event Actions Using MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/implement-jquery-mootools-event" rel="bookmark" title="Permanent Link: Implementing jQuery-Like Event Syntax in MooTools">Implementing jQuery-Like Event Syntax in&nbsp;MooTools</a></li>
<li><a href="http://davidwalsh.name/dwclickable-entire-block-clickable-mootools" rel="bookmark" title="Permanent Link: dwClickable:  Entire Block Clickable Using MooTools 1.2">dwClickable:  Entire Block Clickable Using MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/animated-ajax-record-deletion-mootools" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using MooTools">Animated Ajax Record Deletion Using&nbsp;MooTools</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/aa9be_k8uWzc8i7P0" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-withmootools/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>7 Signs I Knew I Was Born To Be a&#160;Programmer</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-aprogrammer/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-aprogrammer/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:13:11 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[allergic to the sun]]></category>
		<category><![CDATA[cook breakfast]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[day]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[God]]></category>
		<category><![CDATA[Kate Beckinsale]]></category>
		<category><![CDATA[migraine headaches]]></category>
		<category><![CDATA[perfect excuse]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[Than I Really]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-aprogrammer/</guid>
		<description><![CDATA[This will probably shock you but I&#8217;m a programmer. Not a designer, not a copywriter, just a simple programmer. I&#8217;ve done some self analysis and realized that becoming a programmer wasn&#8217;t a choice &#8212; it was destiny. The following is my logic for why I became a programmer. 1. I&#8217;m Allergic to the Sun I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>This will probably shock you but I&#8217;m a programmer.  Not a designer, not a copywriter, just a simple programmer.  I&#8217;ve done some self analysis and realized that becoming a programmer wasn&#8217;t a choice &#8212; it was destiny.  The following is my logic for why I became a programmer.</p>
<h2>1.  I&#8217;m Allergic to the Sun</h2>
<p>I&#8217;m not as hot as <a href="http://www.imdb.com/name/nm0000295/">Kate Beckinsale</a> but I&#8217;m just as allergic to the sun as she was in <a href="http://www.imdb.com/title/tt0320691/">Underworld</a>.  The second I see the sun I sneeze.  What&#8217;s odd is that I used to play outside endlessly as a child &#8212; it wasn&#8217;t until I became a programmer that I developed this strange allergy to the sun.  Today my skin is very white &#8212; a monitor tan is the only tan I get these days.</p>
<h2>2.  I Get Nosebleeds Often</h2>
<p>No true nerd gets their official credentials without proof of frequent nosebleeds.  Unprovoked and unexplainable, my nosebleeds just appear out of thin air&#8230;literally.  These pick up quite a bit during the winter.  I&#8217;ve broken my nose three times but no way to confirm that being a contributing factor.</p>
<h2>3.  I Have No Immune System</h2>
<p>Most of my &#8220;vacation days&#8221; (PTO) are used up by illnesses that range from migraine headaches to pneumonia to bronchitis.  I have the sniffles 365 days a year.  I&#8217;ll wake up with a sore throat in mid-June.  My body has no desire to fight viruses.  A perfect excuse to avoid manual labor and sit behind a monitor inside my condo.</p>
<h2>4.  I Have No &#8220;Real Life&#8221; Skills</h2>
<p>You know how grown men are supposed to be able to change their oil, cook breakfast for their significant other, and do their own laundry?  Yeah, not me.  No joke &#8212; I tried making eggs a few months ago, messed something up, and my kitchen smelled funky for the rest of the day.  I&#8217;m a complete train wreck when not located within three feet of a computer.</p>
<h2>5.  I Have No &#8220;Social&#8221; Skills; Computer &gt; Human<br />
</h2>
<p>I&#8217;m not what you&#8217;d consider a &#8220;people person.&#8221;  I&#8217;d rather spend 20 minutes typing an email than 3 minutes on the phone.  I simply don&#8217;t have that gene.  When coworkers say hello to me at work I usually reply with &#8220;email me.&#8221;  I&#8217;m charming via email, stone cold in person.</p>
<h2>6.  I Think I&#8217;m Much Smarter Than I Really Am</h2>
<p>Like any good egotistical programmer, I feel I&#8217;m much smarter than I am.  Yeah, I slang terms like &#8220;prototypal inheritance&#8221;, &#8220;event delegation&#8221;, and many other impressive programming terms, but can I make eggs?  No.  Doesn&#8217;t matter.  Why?  Because I can slang terms to people who aren&#8217;t computer savvy and help fix email problems.  I think I belong in MENSA &#8212; most other things I belong in on a seat in the corner of the room with a coloring book and non-toxic crayons.</p>
<h2>7.  Fashion == null</h2>
<p>I cannot stand &#8220;bros&#8221; that wear $200 jeans and $50 Hollister/Abercrombie/American Eagle T-Shirts.  I see a <a href="http://media.photobucket.com/image/broseph/samuelsessa/broseph.jpg">Broseph</a> walk down the sidewalk with white shades and a fro-hawk and choke on my own vomit&#8230;..yet I have no problem with wearing one of my 5 MooTools shirts to any event. Wedding? Yes&#8230;because MooTools has Class.  So simple.</p>
<p>I&#8217;m a complete nerd for those scoring at home.  The life of a programmer as a tough one&#8230;God only knows how I can get through each day.</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/born-programmer">7 Signs I Knew I Was Born To Be a&nbsp;Programmer</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/ways-programmers-stay-sane" rel="bookmark" title="Permanent Link: 8 Ways For A Programmer To Stay Sane">8 Ways For A Programmer To Stay&nbsp;Sane</a></li>
<li><a href="http://davidwalsh.name/9-signs-not-to-hire-that-web-guy" rel="bookmark" title="Permanent Link: 9 Signs You Shouldn’t Hire THAT Web Guy">9 Signs You Shouldn&#8217;t Hire THAT Web&nbsp;Guy</a></li>
<li><a href="http://davidwalsh.name/love-web-programming-design" rel="bookmark" title="Permanent Link: Why Do You Love Web Programming and Design?">Why Do You Love Web Programming and&nbsp;Design?</a></li>
<li><a href="http://davidwalsh.name/startup-schwag" rel="bookmark" title="Permanent Link: Startup Schwag: A Web 2.0 Goody Bag">Startup Schwag: A Web 2.0 Goody&nbsp;Bag</a></li>
<li><a href="http://davidwalsh.name/fun-source-code" rel="bookmark" title="Permanent Link: Fun With Source Code">Fun With Source&nbsp;Code</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/2ff84_YAECwVuk8bw" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-aprogrammer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically Create Charts Using jQuery Flot and Google&#160;Analytics</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-googleanalytics/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-googleanalytics/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:11:42 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[backgroundcolor]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Flot]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[month]]></category>
		<category><![CDATA[php echo]]></category>
		<category><![CDATA[true grid]]></category>
		<category><![CDATA[year]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-googleanalytics/</guid>
		<description><![CDATA[Earlier in the week I published a popular article titled Dynamically Create Charts Using MooTools MilkChart and Google Analytics. My post showed you how to use MooTools MilkChart and a splash of PHP to create beautiful charts of Google Analytics data. I was interested in seeing what jQuery had to offer in the charting department. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/aff6e_flot.png" alt="jQuery Flot" /></p>
<p>Earlier in the week I published a popular article titled <a href="http://davidwalsh.name/milkchart">Dynamically Create Charts Using MooTools MilkChart and Google Analytics</a>.  My post showed you how to use MooTools MilkChart and a splash of PHP to create beautiful charts of Google Analytics data.  I was interested in seeing what jQuery had to offer in the charting department.  <a href="http://code.google.com/p/flot/">jQuery Flot</a> is what I found.</p>
<div><a href="http://davidwalsh.name/dw-content/flot.php?month=9&amp;year=2009">View Demo</a>
<div></div>
</div>
<h2>The PHP</h2>
<pre>
/* defaults */
$month = date('n');
$year = date('Y');

/* submission? */
if($_GET['month'] || $_GET['year']):
	/* cleanse lookups */
	$month = (int) $_GET['month']; if(!$month) { $month = 1; }
	$year = (int) $_GET['year']; if(!$year) { $year = date('Y'); }
	/* retrieve information from google analytics */
	require 'ga/analytics.class.php';
	$analytics = new analytics('you&#114;a&#99;c&#111;&#117;&#110;&#116;&#64;&#103;&#109;ail&#46;c&#111;m', 'password');
	$analytics-&gt;setProfileByName('yourdomain.com');
	$analytics-&gt;setMonth($month,$year);
	$visits = $analytics-&gt;getVisitors();
	$views = $analytics-&gt;getPageviews();
	/* build tables */
	if(count($visits)) {
		foreach($visits as $day=&gt;$visit) {
			$flot_datas_visits[] = '['.$day.','.$visit.']';
			$flot_datas_views[] = '['.$day.','.$views[$day].']';
		}
		$flot_data_visits = '['.implode(',',$flot_datas_visits).']';
		$flot_data_views = '['.implode(',',$flot_datas_views).']';
	}
endif;
</pre>
<p>The above code is the same as my MooTools post with the exception of the statistics output format.  jQuery flot prefers arrays instead of  a  HTML table.</p>
<h2>The jQuery Flot Javascript</h2>
<pre>
$(document).ready(function() {
	var visits = &lt;?php echo $flot_data_visits; ?&gt;;
	var views = &lt;?php echo $flot_data_views; ?&gt;;
	$('#placeholder').css({
		height: '400px',
		width: '600px'
	});
	$.plot($('#placeholder'),[
			{ label: 'Visits', data: visits },
			{ label: 'Pageviews', data: views }
		],{
	        lines: { show: true },
	        points: { show: true },
	        grid: { backgroundColor: '#fffaff' }
	});
});
</pre>
<p>The above is a simple example of using jQuery Flot&#8217;s plot method.  Simply provide the placeholder and statistical data from the PHP above.</p>
<div><a href="http://davidwalsh.name/dw-content/flot.php?month=9&amp;year=2009">View Demo</a>
<div></div>
</div>
<h2>Comparison</h2>
<ul>
<li>jQuery Flot provides IE support via ExCanvas, which is great.</li>
<li>MilkChart allows for pie charts while Flot doesn&#8217;t.  I prefer pie charts to other chart types.</li>
<li>MilkChart allows for easy creation of charts from HTML tables (good for accessibility) while jQuery Flot requires an array syntax.</li>
</ul>
<p>What do you think?  Which method do you prefer?</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/jquery-flot">Dynamically Create Charts Using jQuery Flot and Google&nbsp;Analytics</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/milkchart" rel="bookmark" title="Permanent Link: Dynamically Create Charts Using MooTools MilkChart and Google Analytics">Dynamically Create Charts Using MooTools MilkChart and Google&nbsp;Analytics</a></li>
<li><a href="http://davidwalsh.name/php-google-analytics" rel="bookmark" title="Permanent Link: Retrieve Google Analytics Visits and PageViews with PHP">Retrieve Google Analytics Visits and PageViews with&nbsp;PHP</a></li>
<li><a href="http://davidwalsh.name/secure-ssl-google-analytics" rel="bookmark" title="Permanent Link: Secure (SSL) Google Analytics">Secure (SSL) Google&nbsp;Analytics</a></li>
<li><a href="http://davidwalsh.name/track-ajax-link-clicks-google-analytics" rel="bookmark" title="Permanent Link: Track Ajax Link Clicks Using Google Analytics">Track Ajax Link Clicks Using Google&nbsp;Analytics</a></li>
<li><a href="http://davidwalsh.name/track-file-downloads-google-analytics-mootools" rel="bookmark" title="Permanent Link: Track File Downloads in Google Analytics Using MooTools">Track File Downloads in Google Analytics Using&nbsp;MooTools</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/aff6e_NGFyoAPPVL0" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-googleanalytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fancy FAQs with MooTools Sliders: Version&#160;2</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version2/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version2/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:10:38 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[answer]]></category>
		<category><![CDATA[bare necessities]]></category>
		<category><![CDATA[css faqs]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[fames]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[Hide]]></category>
		<category><![CDATA[html structure]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[parent element]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version2/</guid>
		<description><![CDATA[A little over a year ago I authored a post titled Fancy FAQs with MooTools Sliders. My post detailed a method of taking boring FAQs and making them more robust using the world&#8217;s best javascript framework: MooTools. I&#8217;ve taken some time to improve my original code for optimal performance and functionality. View Accessible Demo View [...]]]></description>
			<content:encoded><![CDATA[<p>A little over a year ago I authored a post titled <a href="http://davidwalsh.name/flashy-faqs-mootools-sliders">Fancy FAQs with MooTools Sliders</a>.  My post detailed a method of taking boring FAQs and making them more robust using the world&#8217;s best javascript framework:  MooTools.  I&#8217;ve taken some time to improve my original code for optimal performance and functionality.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php">View Accessible Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php?effect">View Effect Demo</a></p>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
<div>
<h3>This is question 1</h3>
<div>

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae....
</div>
<h3>This is question 2</h3>
<div>

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae....
</div>
</div>
</pre>
<p>Our MooTools javascript will be reliant upon a simple HTML structure of H3s followed by DIVs.</p>
<h2>The CSS</h2>
<pre>
#faqs h3	{ cursor:pointer; }
#faqs h3.active	{ color:#d74646; }
#faqs div   {  }
</pre>
<p>You see I have very little CSS above &#8212; just the bare necessities.  It&#8217;s up to you to make the content even more sexy.  Maybe add some tweening on the content DIV when they show and hide.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function() {
	$$('#faqs h3').each(function(header,i) {
		var state = false, answer = header.getNext('div');
		answer.slide('out');
		header.addEvent('click',function(e) {
			state = !state;
			answer.slide(state ? 'in' : 'out');
			if(state) {
				header.addClass('active');
			}
			else {
				header.removeClass('active');
			}
		});
	});
});
</pre>
<p>We start by grabbing all of the H3 tags within the designated parent element.  We then:</p>
<ol>
<li>Cycle through each heading (the &#8220;question&#8221;)</li>
<li>Grab the next DIV and consider it our &#8220;content&#8221; container (the &#8220;answer&#8221;)</li>
<li>Slide the answer out of view</li>
<li>Add a click event to the question which will toggle the display of the answer.</li>
</ol>
<h2>Another Take</h2>
<p>The above code is accessible but sacrifices a clean effect during normal page load because you see a &#8220;flicker&#8221; of all of the answers displaying before javascript hides them.  If accessibility is less of a concern and you want a smoother effect, consider adding the following CSS and javascript:</p>
<pre>
#faqs div	{ height:0; overflow:hidden; }
</pre>
<p>&#8230;and the javascript&#8230;</p>
<pre>
window.addEvent('domready',function() {
	$$('#faqs h3').each(function(header,i) {
		var state = false;
		var answer = header.getNext('div');
		answer.slide('out');
		header.addEvent('click',function(e) {
			state = !state;
			answer.slide(state ? 'in' : 'out');
			if(state) {
				header.addClass('active');
			}
			else {
				header.removeClass('active');
			}
		});
		answer.setStyles({
			overflow: '',
			height: 'auto'
		});
	});
});
</pre>
<p>This effect is much smoother.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php">View Accessible Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php?effect">View Effect Demo</a></p>
<div></div>
</div>
<p>So what do you think?  Would you use this on a customer site?</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/fancy-faqs">Fancy FAQs with MooTools Sliders: Version&nbsp;2</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/flashy-faqs-mootools-sliders" rel="bookmark" title="Permanent Link: Flashy FAQs Using MooTools Sliders">Flashy FAQs Using MooTools&nbsp;Sliders</a></li>
<li><a href="http://davidwalsh.name/glitter-navigation-mootools-javascript" rel="bookmark" title="Permanent Link: Fancy Navigation with MooTools Javascript">Fancy Navigation with MooTools&nbsp;Javascript</a></li>
<li><a href="http://davidwalsh.name/mootools-show-hide" rel="bookmark" title="Permanent Link: Implementing Basic and Fancy Show/Hide in MooTools 1.2">Implementing Basic and Fancy Show/Hide in MooTools&nbsp;1.2</a></li>
<li><a href="http://davidwalsh.name/facebook-sliders-with-mootools-and-css-now-with-image-generation" rel="bookmark" title="Permanent Link: Facebook Sliders With Mootools and CSS – Now With Image Generation!">Facebook Sliders With Mootools and CSS &#8211; Now With Image&nbsp;Generation!</a></li>
<li><a href="http://davidwalsh.name/toggle-slider-mootools" rel="bookmark" title="Permanent Link: Build a Toggling Announcement Slider Using MooTools 1.2">Build a Toggling Announcement Slider Using MooTools&nbsp;1.2</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/d698a_e7R98BsggTw" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New York Times-Style Text Selection Widget Using MooTools or jQuery</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-or-jquery/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-or-jquery/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:27:18 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[Aaron Newton]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[mysql optimization]]></category>
		<category><![CDATA[New York]]></category>
		<category><![CDATA[new york time]]></category>
		<category><![CDATA[security shell]]></category>
		<category><![CDATA[selection]]></category>
		<category><![CDATA[selection createrange]]></category>
		<category><![CDATA[selectionImage]]></category>
		<category><![CDATA[shell theory]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-or-jquery/</guid>
		<description><![CDATA[Aaron Newton made a great request to me last week: why not make my MooTools Documentation Bookmarklet function more like the New York Time&#8217;s text selection widget. NYT&#8217;s text selection widget listens for text selection and presents the user with a &#8220;search&#8221; icon they may click on to learn more about that term. I&#8217;ve tried [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/dcccc_nytimeswidget.jpg" alt="NY Times Widget" />
</p>
<p>Aaron Newton made a great request to me last week:  why not make my <a href="http://davidwalsh.name/mootools-documentation">MooTools Documentation Bookmarklet</a> function more like the New York Time&#8217;s text selection widget.  NYT&#8217;s text selection widget listens for text selection and presents the user with a &#8220;search&#8221; icon they may click on to learn more about that term.  I&#8217;ve tried to answer that challenge &#8212; not in bookmarklet form but in website widget form.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/selection-search.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/selection-search.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<h2>The Sample HTML</h2>
<pre>
&lt;div id=&quot;content-area&quot;&gt;
	.htaccess AJAX Apache / Server APIs Blog Bookmarking / Social Books Browsers CSS / Design Google Guest Blogger Hosting / Domain Javascript jQuery
	link() Microsoft MooTools MySQL Optimization PHP Poll rand() Security Shell Theory / Ideas Usability / Accessibility XML / XHTML
	This blog is targeted toward all levels of web designers and developers. All web topics are discussed, including CSS, Javascript (MooTools and jQuery), PHP, and more.
&lt;/div&gt;
</pre>
<p>The above code is next to meaningless per the widget &#8212; I simply want to illustrate the area I&#8217;d like it to work in has an ID of <span>content-area</span>.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function(){
	(function($) {
		//gets the selected text
		var getSelection = function() {
			return $try(
				function() { return window.getSelection(); },
				function() { return document.getSelection(); },
				function() {
			        var selection = document.selection &amp;&amp; document.selection.createRange();
					if(selection.text) { return selection.text; }
					return false;
			      }
			) || false;
		};
		//vars
		var url = 'http://davidwalsh.name/?s={term}', selectionImage;
		//event to listen
		$('content-area').addEvent('mouseup',function(e) {
			var selection = getSelection();
			if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
				//ajax here { http://davidwalsh.name/text-selection-ajax }
				if(!selectionImage) {
					selectionImage = new Element('a',{
						href: url,
						opacity:0,
						id: 'selection-image',
						title: 'Click here to learn more about this term',
						target: '_blank',
						fade: { duration:50 }
					}).inject(document.body,'top');
				}
				//handle the every-time event
				//alert(selection);
				selectionImage.set('href',url.replace('{term}',encodeURI(selection))).setStyles({
					top: e.page.y - 30,	//offsets
					left: e.page.x - 13 //offsets
				}).fade('in');
			}
		});

		$(document.body).addEvent('mousedown',function() {
			//hider
			if(selectionImage) { selectionImage.fade('out'); }
		});

	})(document.id);
});
</pre>
<p>During the <span>mouseup</span> event within the selected container (<span>content-area</span>), we determine if any text has been highlighted.  If so, we:</p>
<ol>
<li>Insert the <span>A</span> element if it has not yet been injected into the body.</li>
<li>Change the <span>A</span> element&#8217;s URL to accommodate for the new search term.</li>
<li>Position the element to at an offset position above where the mouse goes up.</li>
</ol>
<p>During every <span>mousedown</span> event we hide the <span>A</span> element.</p>
<h2>The jQuery Javascript</h2>
<pre>
/* attempt to find a text selection */
function getSelected() {
	if(window.getSelection) { return window.getSelection(); }
	else if(document.getSelection) { return document.getSelection(); }
	else {
		var selection = document.selection &amp;&amp; document.selection.createRange();
		if(selection.text) { return selection.text; }
		return false;
	}
	return false;
}
/* create sniffer */
$(document).ready(function() {
	var url = 'http://davidwalsh.name/?s={term}', selectionImage;
	$('#content-area').mouseup(function(e) {
		var selection = getSelected();
		if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
			//ajax here { http://davidwalsh.name/text-selection-ajax }
			if(!selectionImage) {
				selectionImage = $('&lt;a&gt;').attr({
					href: url,
					title: 'Click here to learn more about this term',
					target: '_blank',
					id: 'selection-image'
				}).hide();
				$(document.body).append(selectionImage);
			}
			selectionImage.attr('href',url.replace('{term}',encodeURI(selection))).css({
				top: e.pageY - 30,	//offsets
				left: e.pageX - 13 //offsets
			}).fadeIn();
		}
	});
	$(document.body).mousedown(function() {
		if(selectionImage) { selectionImage.fadeOut(); }
	});
});
</pre>
<p>Follows the same principal as above.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/selection-search.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/selection-search.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<h2>Ideas &amp; Enhancements</h2>
<ul>
<li>Depending on your philosophy, you may want to implement a minimum character check as well:</p>
<pre>
if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,'')) &amp;&amp; selection.length &gt; 4) { //5 char min
</pre>
</li>
<li>You may want to also fidget with adding/modifying text selection with keyboard keys as well.  I&#8217;ve chosen to pass on that.</li>
<li><a href="http://davidwalsh.name/text-selection-ajax">Saving the selection content via AJAX</a> for analytical reasons may not be a bad idea either.</li>
</ul>
<p>Have any other ideas for improvement?  Would you have any use for this on your website(s)?</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/text-select-widget">New York Times-Style Text Selection Widget Using MooTools or jQuery</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/text-selection-ajax" rel="bookmark" title="Permanent Link: Record Text Selections Using MooTools or jQuery AJAX">Record Text Selections Using MooTools or jQuery AJAX</a></li>
<li><a href="http://davidwalsh.name/csstricks-css-text-selection-highlighting" rel="bookmark" title="Permanent Link: CSS-Tricks — CSS &amp; Text Selection &amp; Highlighting">CSS-Tricks &#8212; CSS &#38; Text Selection &#38; Highlighting</a></li>
<li><a href="http://davidwalsh.name/script-style-favelet" rel="bookmark" title="Permanent Link: Script &amp; Style Revamp with Submission Favelet">Script &#38; Style Revamp with Submission Favelet</a></li>
<li><a href="http://davidwalsh.name/digg-share-widget" rel="bookmark" title="Permanent Link: Digg-Style Dynamic Share Widget Using MooTools">Digg-Style Dynamic Share Widget Using MooTools</a></li>
<li><a href="http://davidwalsh.name/load-more-widget" rel="bookmark" title="Permanent Link: David Walsh on NetTuts:  Create a Twitter-Like “Load More” Widget">David Walsh on NetTuts:  Create a Twitter-Like “Load More” Widget</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/dcccc_mpq-5qKrGKE" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/new-york-times-style-text-selection-widget-using-mootools-or-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Record Text Selections Using MooTools or jQuery AJAX</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jquery-ajax/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jquery-ajax/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:27:05 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[document selection]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[javascript library]]></category>
		<category><![CDATA[Return]]></category>
		<category><![CDATA[return document]]></category>
		<category><![CDATA[selection]]></category>
		<category><![CDATA[selection createrange]]></category>
		<category><![CDATA[selection function]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jquery-ajax/</guid>
		<description><![CDATA[One technique I&#8217;m seeing more and more these days (CNNSI.com, for example) is AJAX recording of selected text. It makes sense &#8212; if you detect users selecting the terms over and over again, you can probably assume your visitors are searching that term on Google, Yahoo, etc. I&#8217;ve duplicated this functionality using my favorite javascript [...]]]></description>
			<content:encoded><![CDATA[<p>One technique I&#8217;m seeing more and more these days (CNNSI.com, for example) is AJAX recording of selected text.  It makes sense &#8212; if you detect users selecting the terms over and over again, you can probably assume your visitors are searching that term on Google, Yahoo, etc.  I&#8217;ve duplicated this functionality using my favorite javascript library, MooTools, and another javascript library, jQuery.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function(){
	//gets the selected text
	var getSelection = function() {
		return $try(
			function() { return window.getSelection(); },
			function() { return document.getSelection(); },
			function() {
					var selection = document.selection &#38;&#38; document.selection.createRange();
					if(selection.text) { return selection.text; }
					return false;
		      }
		) || false;
	};
	//event to listen
	var selectRequest = new Request({
		url: 'ajax-selection-copy.php',
		method: 'post'
	});
	$('content-area').addEvent('mouseup',function(e) {
		var selection = getSelection();
		if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
			selectRequest.send('selection=' + encodeURI(selection));
		}
	});
});
</pre>
<p>The first step is attempting to grab the selected text during the <span>mouseup</span> within our designated container.  If we find a text selection we fire an AJAX request to a PHP script which will save the text selection.</p>
<h2>The jQuery Javascript</h2>
<pre>
/* attempt to find a text selection */
function getSelected() {
	if(window.getSelection) { return window.getSelection(); }
	else if(document.getSelection) { return document.getSelection(); }
	else {
		var selection = document.selection &#38;&#38; document.selection.createRange();
		if(selection.text) { return selection.text; }
		return false;
	}
	return false;
}
/* create sniffer */
$(document).ready(function() {
	$('#content-area').mouseup(function() {
		var selection = getSelected();
		if(selection &amp;&amp; (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
			$.ajax({
				type: 'post',
				url: 'ajax-selection-copy.php',
				data: 'selection=' + encodeURI(selection)
			});
		}
	});
});
</pre>
<p>The MooTools code translated to jQuery.</p>
<h2>The PHP</h2>
<pre>
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' &amp;&amp; $selection = trim($_POST['selection'])) {
	mysql_query('INSERT INTO text_selections (selection,date_selected) VALUES(\''.mysql_escape_string(stripslashes($selection)).'\',NOW())');
}
</pre>
<p>The above PHP code is very primitive.  Depending on the setup of your system (PHP Framework, security settings, etc.) you will want to implement additional measures to prevent attacks on this script.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php">View MooTools Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/ajax-selection-copy.php?library=jquery">View jQuery Demo</a></p>
<div></div>
</div>
<p>Recording text selections is a great way to discover what topics and/or terms your audience is interested in.  You may also want to provide more information on these terms within posts.</p>
<p>What are your thoughts on this?  Do you think this is too much like <a href="http://davidwalsh.name/ajax-evil-spyjax">Spyjax</a>?  Perfectly OK?</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/text-selection-ajax">Record Text Selections Using MooTools or jQuery AJAX</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/animated-ajax-jquery" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using jQuery">Animated Ajax Record Deletion Using jQuery</a></li>
<li><a href="http://davidwalsh.name/animated-ajax-record-deletion-mootools" rel="bookmark" title="Permanent Link: Animated Ajax Record Deletion Using MooTools">Animated Ajax Record Deletion Using MooTools</a></li>
<li><a href="http://davidwalsh.name/google-load" rel="bookmark" title="Permanent Link: google.load():  Utilize Google’s Ajax Libraries API">google.load():  Utilize Google&#8217;s Ajax Libraries API</a></li>
<li><a href="http://davidwalsh.name/ajax-spinner-jquery" rel="bookmark" title="Permanent Link: Form Element AJAX Spinner Attachment Using jQuery">Form Element AJAX Spinner Attachment Using jQuery</a></li>
<li><a href="http://davidwalsh.name/broken-images-jquery-ajax" rel="bookmark" title="Permanent Link: Send Email Notifications for Broken Images Using jQuery Ajax">Send Email Notifications for Broken Images Using jQuery Ajax</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/41630_czUFGTW9u7w" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/record-text-selections-using-mootools-or-jquery-ajax/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>An Open Letter to You, Webmaster II</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmaster-ii/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmaster-ii/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:45:05 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[advanced javascript]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[client websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[David WalshSenior]]></category>
		<category><![CDATA[extra hour]]></category>
		<category><![CDATA[I.  I]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[meta keywords]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[webmaster]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmaster-ii/</guid>
		<description><![CDATA[Dear Webmaster, It&#8217;s been over a year since I last wrote. Business is booming for me which reminded me to get in touch with you again. I&#8217;m shocked at the advancements you&#8217;ve made! Wow &#8212; you&#8217;ve gotten acquainted with javascript frameworks! In fact, it appears you&#8217;ve gotten so good with the popular javascript frameworks that [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/b9be2_webmastador.jpg" alt="Webmaster" /></p>
<p>Dear Webmaster,</p>
<p>It&#8217;s been over a year <a href="http://davidwalsh.name/open-letter-webmaster">since I last wrote</a>. Business is booming for me which reminded me to get in touch with you again.  I&#8217;m shocked at the advancements you&#8217;ve made!</p>
<p>Wow &#8212; you&#8217;ve gotten acquainted with javascript frameworks!  In fact, it appears you&#8217;ve gotten so good with the popular javascript frameworks that you&#8217;re using multiple in each of your client websites.  I see jQuery, MooTools, and Dojo in the same page!  Good idea &#8212; the more frameworks you add to the page, the more plugins you can add without needing to code any javascript yourself.  Well thought-out.  I also see that you&#8217;re adding javascript frameworks for simple getElementById() selection &#8212; why not?  I&#8217;m sure you&#8217;ll use more advanced javascript on your client&#8217;s website at some point, so best to include the libraries now.</p>
<p>I also noticed that you&#8217;ve completely dropped support of Internet Explorer 6.  My favorite touch is the &#8220;upgrade your browser&#8221; message you&#8217;ve added to your client websites, no doubt without their permission.  I admire your resolve &#8212; why should you go through the hassle of spending an extra hour to make your site work in IE6?  Let the visitor suffer and the client lose business &#8212; you don&#8217;t need the headache of dealing with IE6.  Another intelligent philosophy.</p>
<p>You&#8217;ve obviously taken a search engine optimization class because I can see loads of keywords in every sentence within the content area.  Writing content for the user is overrated &#8212; writing content for Google?  Brilliant!  Who cares if the sentences are so bloated the visitor can&#8217;t read them;  they wouldn&#8217;t have gotten to the client&#8217;s website without Google!  And I see that despite no search engines still supporting meta keywords, you&#8217;re still selling them.  The client doesn&#8217;t know any better so we&#8217;ll keep that between you and I.  I also see that your page file names are stuff with 5-10 keywords&#8230;genius!  Those will most definitely rank highly!</p>
<p>I see you&#8217;ve chosen to keep your CSS verbose.  Shorthand CSS is clearly a fad that you aren&#8217;t going to get tricked into &#8212; clever thinking!  Of course shorthand CSS is less code but hell, there&#8217;s a lot to remember when you use shorthand CSS!  And using text-transform to capitalize letters?  Please!  Why use CSS when you can simply capitalize verbiage with PHP&#8217;s or easier yet, type in the text with caps-lock cemented down?</p>
<p>You&#8217;ve added your personal Twitter feed to your own website &#8212; great!  Sure you often cuss in your tweets and post links to inappropriate media but you SOMETIMES post web-relevant tweets which will help you gain clients.  What&#8217;s also impressive is that you&#8217;ve implemented Google Adsense on your website &#8212; extra income FTW!  Who cares if ads for other web design agencies are shown?  They already on your website so they&#8217;ve found their desired vendor &#8212; you!</p>
<p>Your website also states that you offer no phone support, only email support within limited hours per day.  Now that&#8217;s an idea based on convenience&#8230;not for the customer, but for you.  An overwhelming theme with your services.  And I understand completely &#8212; you have a busy life!  It&#8217;s not fair that a client call and interrupt anything you&#8217;re doing.</p>
<p>As always Webmaster, I appreciate what you do.  A respected Senior Web Developer like myself cannot put food on the table without help from people like you.  You&#8217;re a dying breed, Webmaster.  Stay strong my friend &#8212; serious Web Developers like me need you out there.</p>
<p>Sincerely,</p>
<p>David Walsh<br />Senior Web Developer</p>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/open-letter-webmaster-ii">An Open Letter to You, Webmaster II</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/open-letter-webmaster" rel="bookmark" title="Permanent Link: An Open Letter to You, Webmaster">An Open Letter to You, Webmaster</a></li>
<li><a href="http://davidwalsh.name/does-open-source-mean-you-cant-bitch" rel="bookmark" title="Permanent Link: Does Open Source Mean You Can’t Bitch?">Does Open Source Mean You Can&#8217;t Bitch?</a></li>
<li><a href="http://davidwalsh.name/ii" rel="bookmark" title="Permanent Link: I Want You II">I Want You II</a></li>
<li><a href="http://davidwalsh.name/want-guest-bloggers" rel="bookmark" title="Permanent Link: Wanna Be Me?  I Want You!">Wanna Be Me?  I Want You!</a></li>
<li><a href="http://davidwalsh.name/mailbag-ii-answers" rel="bookmark" title="Permanent Link: Mailbag Q &amp; A II Answers">Mailbag Q &#38; A II Answers</a></li>
</ol>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/b9be2_XL83_qVJ7Mc" height="1" width="1" /><br />
<a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/an-open-letter-to-you-webmaster-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounded Corners in Internet Explorer</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internet-explorer/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internet-explorer/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 16:27:07 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[code fixes]]></category>
		<category><![CDATA[corner elements]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CurvyCorners]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Explorer]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[internet explorer cannot open the internet site]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internet-explorer/</guid>
		<description><![CDATA[One of the reasons that I love Firefox and Webkit-based browsers (Chrome, Safari) is the ability to effortlessly create rounded-corner elements using pure CSS: .round { -moz-border-radius:12px; -webkit-border-radius:12px; } As you probably already know, IE doesn&#8217;t allow you to create rounded corners without using images or endless hacking. Enter the CurvyCorners javascript project. CurvyCorners allows [...]]]></description>
			<content:encoded><![CDATA[<p>
<p><a href="http://davidwalsh.name/dw-content/curvy-corners.php"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/e8a54_roundedcorners.png" alt="Rounded Corners" /></a></p>
<p>One of the reasons that I love Firefox and Webkit-based browsers (Chrome, Safari) is the ability to effortlessly create rounded-corner elements using pure CSS:</p>
<pre>
.round	{ -moz-border-radius:12px; -webkit-border-radius:12px; }
</pre>
<p>As you probably already know, IE doesn&#8217;t allow you to create rounded corners without using images or endless hacking.  Enter the <a href="http://code.google.com/p/curvycorners">CurvyCorners javascript project</a>.  CurvyCorners allows you to quickly create rounded corners within Internet Explorer.</p>
<div><a href="http://davidwalsh.name/dw-content/curvy-corners.php">View Demo</a>
<div></div>
</div>
<h2>The CurvyCorners Javascript</h2>
<pre>
&lt;!-- SIMPLY INCLUDE THE JS FILE! --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;curvy.corners.trunk.js&quot;&gt;&lt;/script&gt;
</pre>
<p>CurvyCorners detects the usage of &#8220;-webkit-border-radius&#8221; and &#8220;moz-border-radius&#8221; on DOM elements and works its magic to duplicate the effect in IE using a series of small DIVs.  There are no images involved.  You may also identify specific elements to apply rounded corners to:</p>
<pre>
var settings = {
			tl: { radius: 12 },
			tr: { radius: 12 },
			bl: { radius: 12 },
			br: { radius: 12 },
			antiAlias: true
		 };
/* moooo */
$$('.round').each(function(rd) {
	curvyCorners(settings,rd);
});
</pre>
<h2>MooTools  + Curvy Corners</h2>
<p>CurvyCorners is known to brick your MooTools code.  The <a href="http://code.google.com/p/curvycorners/source/browse/#svn/trunk/examples">trunk code</a> fixes those issues.</p>
<div><a href="http://davidwalsh.name/dw-content/curvy-corners.php">View Demo</a>
<div></div>
</div>
<p>Don&#8217;t let Internet Explorer&#8217;s refusal to implement rounded corners via CSS keep your websites from being as dynamic as possible!  CurvyCorners helps make rounded corners in IE possible!</p>
<div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="left">Send article as PDF to:   </td>
<td align="right"><a href="http://en.pdf24.org" target="_blank" title="PDF Printer"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/3922f_sheep_16x16.gif" alt="PDF Printer" border="0" /></a></td>
</tr>
</table>
</div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/rounded-corners-ie">Rounded Corners in Internet Explorer</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/rounded-corners-webkit" rel="bookmark" title="Permanent Link: Rounded Corners in Webkit">Rounded Corners in Webkit</a></li>
<li><a href="http://davidwalsh.name/rounded-corners-firefox" rel="bookmark" title="Permanent Link: Rounded Corners in Mozilla Firefox">Rounded Corners in Mozilla Firefox</a></li>
<li><a href="http://davidwalsh.name/internet-explorer-cannot-open-internet-site" rel="bookmark" title="Permanent Link: IE Says “Internet Explorer cannot open the Internet Site ________. Operation Aborted.”  I Say “WTF?”">IE Says &#8220;Internet Explorer cannot open the Internet Site ________. Operation Aborted.&#8221;  I Say &#8220;WTF?&#8221;</a></li>
<li><a href="http://davidwalsh.name/css-image-filters-internet-explorer" rel="bookmark" title="Permanent Link: CSS Image Filters in Internet Explorer">CSS Image Filters in Internet Explorer</a></li>
<li><a href="http://davidwalsh.name/chrome-frame" rel="bookmark" title="Permanent Link: Turn Internet Explorer into Chrome with Chrome Frame">Turn Internet Explorer into Chrome with Chrome Frame</a></li>
</ol>
<p><a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/rounded-corners-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Event Delegation with MooTools</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-with-mootools/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-with-mootools/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 17:09:03 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[david walsh]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Delegation]]></category>
		<category><![CDATA[document id]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[new element]]></category>
		<category><![CDATA[sample html]]></category>
		<category><![CDATA[syntax window]]></category>
		<category><![CDATA[Walsh Blog]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-with-mootools/</guid>
		<description><![CDATA[Events play a huge role in javascript. I can&#8217;t name one website I&#8217;ve created in the past two years that hasn&#8217;t used javascript event handling on some level. Ask yourself: how often do I inject elements into the DOM and not add an event to them? For me it&#8217;s very rare. For this reason I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>
<p>Events play a huge role in javascript.  I can&#8217;t name one website I&#8217;ve created in the past two years that hasn&#8217;t used javascript event handling on some level.  Ask yourself:  how often do I inject elements into the DOM and not add an event to them?  For me it&#8217;s very rare.  For this reason I&#8217;m proud and excited for the release of <a href="http://mootools.net/docs/more/Element/Element.Delegation">MooTools 1.2.4&#8217;s Event.Delegation</a> code.</p>
<h2>WTF is Event Delegation?</h2>
<p>Event delegation is the process of assigning an event listener to a parent for all of its children instead of assigning the same event to every child.</p>
<div><a href="http://davidwalsh.name/dw-content/event-delegation.php">View Demo</a>
<div></div>
</div>
<h2>Some Sample HTML</h2>
<pre>
&lt;ul id=&quot;link-list&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name&quot;&gt;David Walsh Blog Link 1&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name&quot;&gt;David Walsh Blog Link 2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name&quot;&gt;David Walsh Blog Link 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>A list with 3 list item elements which contain a link.  For the sake of my example, this list will have list items added to it and we want an alert to pop up any time a link within the list is clicked.</p>
<h2>The MooTools Javascript Event Delegation Syntax</h2>
<pre>
window.addEvent('domready',function() {
	/* delegate */
	document.id('link-list').addEvent('click:relay(a)', function(e){
		e.stop();
		alert('you clicked a link!');
	});
	/*
		Add link to show event delegation works!
		Notice how we haven't assigned an event to this specific element.
		We already added the event to the list element itself
	*/
	document.id('add-link').addEvent('click',function() {
		var li = new Element('li').inject('link-list');
		var link = new Element('a',{ text:'David Walsh Blog', href:'http://davidwalsh.name'}).inject(li);
	});
});
</pre>
<p>All you need to do is add <span>:relay</span> to the parent selector and place the &#8220;children&#8221; match inside the relay pseudo selector.  You&#8217;ll probably question how <span>:relay</span> works because the &#8220;:&#8221; syntax is used for pseudo selectors.  The Element.Delegation javascript download overwrites the addEvent, removeEvent, and fireEvent methods to accommodate for the <span>:relay</span> syntax.</p>
<h2>Event Delegation Replaces&#8230;</h2>
<pre>
var links = document.id('link-list').getElements('li');
links.each(function(link) {
	link.addEvent('click',function() {
		//assign actions here
	});
})
</pre>
<p>Why collect and iterate through elements to add events when you can simply use event delegation?</p>
<div><a href="http://davidwalsh.name/dw-content/event-delegation.php">View Demo</a>
<div></div>
</div>
<p>Event delegation is a great way to avoid repeating the same event assignments for elements within a parent element, especially when you are adding elements into the page dynamically.  If you&#8217;ve not upgraded to MooTools 1.2.4 yet, I hope this is just the kick in the pants you need!</p>
<div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="left">Send article as PDF to:   </td>
<td align="right"><a href="http://en.pdf24.org" target="_blank" title="PDF Download"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/858b3_sheep_16x16.gif" alt="PDF Download" border="0" /></a></td>
</tr>
</table>
</div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/event-delegation">Event Delegation with MooTools</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/mootools-event-delegation" rel="bookmark" title="Permanent Link: MooTools Event Delegation">MooTools Event Delegation</a></li>
<li><a href="http://davidwalsh.name/prevent-default-event-actions-mootools-12" rel="bookmark" title="Permanent Link: Prevent Default Event Actions Using MooTools 1.2">Prevent Default Event Actions Using MooTools 1.2</a></li>
<li><a href="http://davidwalsh.name/implement-jquery-mootools-event" rel="bookmark" title="Permanent Link: Implementing jQuery-Like Event Syntax in MooTools">Implementing jQuery-Like Event Syntax in MooTools</a></li>
<li><a href="http://davidwalsh.name/flip-text" rel="bookmark" title="Permanent Link: MooTools Text Flipping">MooTools Text Flipping</a></li>
<li><a href="http://davidwalsh.name/simple-mootools-event-class-binding" rel="bookmark" title="Permanent Link: Simple MooTools Event / Class Binding">Simple MooTools Event / Class Binding</a></li>
</ol>
<p><a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/event-delegation-with-mootools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>7 Signs I Knew I Was Born To Be a Programmer</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-a-programmer/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-a-programmer/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 17:36:33 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[allergic to the sun]]></category>
		<category><![CDATA[cook breakfast]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[day]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[God]]></category>
		<category><![CDATA[guy]]></category>
		<category><![CDATA[Kate Beckinsale]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[migraine headaches]]></category>
		<category><![CDATA[perfect excuse]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[Than I Really]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-a-programmer/</guid>
		<description><![CDATA[This will probably shock you but I&#8217;m a programmer. Not a designer, not a copywriter, just a simple programmer. I&#8217;ve done some self analysis and realized that becoming a programmer wasn&#8217;t a choice &#8212; it was destiny. The following is my logic for why I became a programmer. 1. I&#8217;m Allergic to the Sun I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>
<p>This will probably shock you but I&#8217;m a programmer.  Not a designer, not a copywriter, just a simple programmer.  I&#8217;ve done some self analysis and realized that becoming a programmer wasn&#8217;t a choice &#8212; it was destiny.  The following is my logic for why I became a programmer.</p>
<h2>1.  I&#8217;m Allergic to the Sun</h2>
<p>I&#8217;m not as hot as <a href="http://www.imdb.com/name/nm0000295/">Kate Beckinsale</a> but I&#8217;m just as allergic to the sun as she was in <a href="http://www.imdb.com/title/tt0320691/">Underworld</a>.  The second I see the sun I sneeze.  What&#8217;s odd is that I used to play outside endlessly as a child &#8212; it wasn&#8217;t until I became a programmer that I developed this strange allergy to the sun.  Today my skin is very white &#8212; a monitor tan is the only tan I get these days.</p>
<h2>2.  I Get Nosebleeds Often</h2>
<p>No true nerd gets their official credentials without proof of frequent nosebleeds.  Unprovoked and unexplainable, my nosebleeds just appear out of thin air&#8230;literally.  These pick up quite a bit during the winter.  I&#8217;ve broken my nose three times but no way to confirm that being a contributing factor.</p>
<h2>3.  I Have No Immune System</h2>
<p>Most of my &#8220;vacation days&#8221; (PTO) are used up by illnesses that range from migraine headaches to pneumonia to bronchitis.  I have the sniffles 365 days a year.  I&#8217;ll wake up with a sore throat in mid-June.  My body has no desire to fight viruses.  A perfect excuse to avoid manual labor and sit behind a monitor inside my condo.</p>
<h2>4.  I Have No &#8220;Real Life&#8221; Skills</h2>
<p>You know how grown men are supposed to be able to change their oil, cook breakfast for their significant other, and do their own laundry?  Yeah, not me.  No joke &#8212; I tried making eggs a few months ago, messed something up, and my kitchen smelled funky for the rest of the day.  I&#8217;m a complete train wreck when not located within three feet of a computer.</p>
<h2>5.  I Have No &#8220;Social&#8221; Skills; Computer &gt; Human<br />
</h2>
<p>I&#8217;m not what you&#8217;d consider a &#8220;people person.&#8221;  I&#8217;d rather spend 20 minutes typing an email than 3 minutes on the phone.  I simply don&#8217;t have that gene.  When coworkers say hello to me at work I usually reply with &#8220;email me.&#8221;  I&#8217;m charming via email, stone cold in person.</p>
<h2>6.  I Think I&#8217;m Much Smarter Than I Really Am</h2>
<p>Like any good egotistical programmer, I feel I&#8217;m much smarter than I am.  Yeah, I slang terms like &#8220;prototypal inheritance&#8221;, &#8220;event delegation&#8221;, and many other impressive programming terms, but can I make eggs?  No.  Doesn&#8217;t matter.  Why?  Because I can slang terms to people who aren&#8217;t computer savvy and help fix email problems.  I think I belong in MENSA &#8212; most other things I belong in on a seat in the corner of the room with a coloring book and non-toxic crayons.</p>
<h2>7.  Fashion == null</h2>
<p>I cannot stand &#8220;bros&#8221; that wear $200 jeans and $50 Hollister/Abercrombie/American Eagle T-Shirts.  I see a <a href="http://media.photobucket.com/image/broseph/samuelsessa/broseph.jpg">Broseph</a> walk down the sidewalk with white shades and a fro-hawk and choke on my own vomit&#8230;..yet I have no problem with wearing one of my 5 MooTools shirts to any event. Wedding? Yes&#8230;because MooTools has Class.  So simple.</p>
<p>I&#8217;m a complete nerd for those scoring at home.  The life of a programmer as a tough one&#8230;God only knows how I can get through each day.</p>
<div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="left">Send article as PDF to:   </td>
<td align="right"><a href="http://en.pdf24.org" target="_blank" title="PDF Printer"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/29791_sheep_16x16.gif" alt="PDF Printer" border="0" /></a></td>
</tr>
</table>
</div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/born-programmer">7 Signs I Knew I Was Born To Be a Programmer</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/ways-programmers-stay-sane" rel="bookmark" title="Permanent Link: 8 Ways For A Programmer To Stay Sane">8 Ways For A Programmer To Stay Sane</a></li>
<li><a href="http://davidwalsh.name/9-signs-not-to-hire-that-web-guy" rel="bookmark" title="Permanent Link: 9 Signs You Shouldn’t Hire THAT Web Guy">9 Signs You Shouldn&#8217;t Hire THAT Web Guy</a></li>
<li><a href="http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back" rel="bookmark" title="Permanent Link: 5 Simple Ways Programmers and Designers Should Give Back">5 Simple Ways Programmers and Designers Should Give Back</a></li>
<li><a href="http://davidwalsh.name/codelish" rel="bookmark" title="Permanent Link: Codelish – A Programmer’s Life Language">Codelish &#8211; A Programmer&#8217;s Life Language</a></li>
<li><a href="http://davidwalsh.name/august-mailbag" rel="bookmark" title="Permanent Link: August Mailbag Q &amp; A">August Mailbag Q &#38; A</a></li>
</ol>
<p><a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/7-signs-i-knew-i-was-born-to-be-a-programmer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically Create Charts Using jQuery Flot and Google Analytics</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-google-analytics/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-google-analytics/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 13:27:05 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[backgroundcolor]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[Flot]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[month]]></category>
		<category><![CDATA[php echo]]></category>
		<category><![CDATA[true grid]]></category>
		<category><![CDATA[year]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-google-analytics/</guid>
		<description><![CDATA[Earlier in the week I published a popular article titled Dynamically Create Charts Using MooTools MilkChart and Google Analytics. My post showed you how to use MooTools MilkChart and a splash of PHP to create beautiful charts of Google Analytics data. I was interested in seeing what jQuery had to offer in the charting department. [...]]]></description>
			<content:encoded><![CDATA[<p>
<p><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/e89ed_flot.png" alt="jQuery Flot" /></p>
<p>Earlier in the week I published a popular article titled <a href="http://davidwalsh.name/milkchart">Dynamically Create Charts Using MooTools MilkChart and Google Analytics</a>.  My post showed you how to use MooTools MilkChart and a splash of PHP to create beautiful charts of Google Analytics data.  I was interested in seeing what jQuery had to offer in the charting department.  <a href="http://code.google.com/p/flot/">jQuery Flot</a> is what I found.</p>
<div><a href="http://davidwalsh.name/dw-content/flot.php?month=9&amp;year=2009">View Demo</a>
<div></div>
</div>
<h2>The PHP</h2>
<pre>
/* defaults */
$month = date('n');
$year = date('Y');

/* submission? */
if($_GET['month'] || $_GET['year']):
	/* cleanse lookups */
	$month = (int) $_GET['month']; if(!$month) { $month = 1; }
	$year = (int) $_GET['year']; if(!$year) { $year = date('Y'); }
	/* retrieve information from google analytics */
	require 'ga/analytics.class.php';
	$analytics = new analytics('yo&#117;&#114;a&#99;co&#117;nt&#64;gma&#105;l&#46;com', 'password');
	$analytics-&gt;setProfileByName('yourdomain.com');
	$analytics-&gt;setMonth($month,$year);
	$visits = $analytics-&gt;getVisitors();
	$views = $analytics-&gt;getPageviews();
	/* build tables */
	if(count($visits)) {
		foreach($visits as $day=&gt;$visit) {
			$flot_datas_visits[] = '['.$day.','.$visit.']';
			$flot_datas_views[] = '['.$day.','.$views[$day].']';
		}
		$flot_data_visits = '['.implode(',',$flot_datas_visits).']';
		$flot_data_views = '['.implode(',',$flot_datas_views).']';
	}
endif;
</pre>
<p>The above code is the same as my MooTools post with the exception of the statistics output format.  jQuery flot prefers arrays instead of  a  HTML table.</p>
<h2>The jQuery Flot Javascript</h2>
<pre>
$(document).ready(function() {
	var visits = &lt;?php echo $flot_data_visits; ?&gt;;
	var views = &lt;?php echo $flot_data_views; ?&gt;;
	$('#placeholder').css({
		height: '400px',
		width: '600px'
	});
	$.plot($('#placeholder'),[
			{ label: 'Visits', data: visits },
			{ label: 'Pageviews', data: views }
		],{
	        lines: { show: true },
	        points: { show: true },
	        grid: { backgroundColor: '#fffaff' }
	});
});
</pre>
<p>The above is a simple example of using jQuery Flot&#8217;s plot method.  Simply provide the placeholder and statistical data from the PHP above.</p>
<div><a href="http://davidwalsh.name/dw-content/flot.php?month=9&amp;year=2009">View Demo</a>
<div></div>
</div>
<h2>Comparison</h2>
<ul>
<li>jQuery Flot provides IE support via ExCanvas, which is great.</li>
<li>MilkChart allows for pie charts while Flot doesn&#8217;t.  I prefer pie charts to other chart types.</li>
<li>MilkChart allows for easy creation of charts from HTML tables (good for accessibility) while jQuery Flot requires an array syntax.</li>
</ul>
<p>What do you think?  Which method do you prefer?</p>
<div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="left">Send article as PDF to:   </td>
<td align="right"><a href="http://en.pdf24.org" target="_blank" title="PDF Creator"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/2c1d5_sheep_16x16.gif" alt="PDF Creator" border="0" /></a></td>
</tr>
</table>
</div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/jquery-flot">Dynamically Create Charts Using jQuery Flot and Google Analytics</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/milkchart" rel="bookmark" title="Permanent Link: Dynamically Create Charts Using MooTools MilkChart and Google Analytics">Dynamically Create Charts Using MooTools MilkChart and Google Analytics</a></li>
<li><a href="http://davidwalsh.name/php-google-analytics" rel="bookmark" title="Permanent Link: Retrieve Google Analytics Visits and PageViews with PHP">Retrieve Google Analytics Visits and PageViews with PHP</a></li>
<li><a href="http://davidwalsh.name/track-file-downloads-google-analytics-mootools" rel="bookmark" title="Permanent Link: Track File Downloads in Google Analytics Using MooTools">Track File Downloads in Google Analytics Using MooTools</a></li>
<li><a href="http://davidwalsh.name/secure-ssl-google-analytics" rel="bookmark" title="Permanent Link: Secure (SSL) Google Analytics">Secure (SSL) Google Analytics</a></li>
<li><a href="http://davidwalsh.name/mootools-google-analytics-track-outbound-links" rel="bookmark" title="Permanent Link: Using MooTools to Instruct Google Analytics to Track Outbound Links">Using MooTools to Instruct Google Analytics to Track Outbound Links</a></li>
</ol>
<p><a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/dynamically-create-charts-using-jquery-flot-and-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fancy FAQs with MooTools Sliders: Version 2</title>
		<link>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version-2/</link>
		<comments>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version-2/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 15:27:05 +0000</pubDate>
		<dc:creator>BlogPoster</dc:creator>
				<category><![CDATA[web resources]]></category>
		<category><![CDATA[answer]]></category>
		<category><![CDATA[bare necessities]]></category>
		<category><![CDATA[css faqs]]></category>
		<category><![CDATA[David Walsh Blog]]></category>
		<category><![CDATA[Don]]></category>
		<category><![CDATA[fames]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[html structure]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[parent element]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version-2/</guid>
		<description><![CDATA[A little over a year ago I authored a post titled Fancy FAQs with MooTools Sliders. My post detailed a method of taking boring FAQs and making them more robust using the world&#8217;s best javascript framework: MooTools. I&#8217;ve taken some time to improve my original code for optimal performance and functionality. View Accessible Demo View [...]]]></description>
			<content:encoded><![CDATA[<p>
<p>A little over a year ago I authored a post titled <a href="http://davidwalsh.name/flashy-faqs-mootools-sliders">Fancy FAQs with MooTools Sliders</a>.  My post detailed a method of taking boring FAQs and making them more robust using the world&#8217;s best javascript framework:  MooTools.  I&#8217;ve taken some time to improve my original code for optimal performance and functionality.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php">View Accessible Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php?effect">View Effect Demo</a></p>
<div></div>
</div>
<h2>The HTML</h2>
<pre>
<div>
<h3>This is question 1</h3>
<div>

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae....
</div>
<h3>This is question 2</h3>
<div>

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae....
</div>
</div>
</pre>
<p>Our MooTools javascript will be reliant upon a simple HTML structure of H3s followed by DIVs.</p>
<h2>The CSS</h2>
<pre>
#faqs h3	{ cursor:pointer; }
#faqs h3.active	{ color:#d74646; }
#faqs div   {  }
</pre>
<p>You see I have very little CSS above &#8212; just the bare necessities.  It&#8217;s up to you to make the content even more sexy.  Maybe add some tweening on the content DIV when they show and hide.</p>
<h2>The MooTools Javascript</h2>
<pre>
window.addEvent('domready',function() {
	$$('#faqs h3').each(function(header,i) {
		var state = false, answer = header.getNext('div');
		answer.slide('out');
		header.addEvent('click',function(e) {
			state = !state;
			answer.slide(state ? 'in' : 'out');
			if(state) {
				header.addClass('active');
			}
			else {
				header.removeClass('active');
			}
		});
	});
});
</pre>
<p>We start by grabbing all of the H3 tags within the designated parent element.  We then:</p>
<ol>
<li>Cycle through each heading (the &#8220;question&#8221;)</li>
<li>Grab the next DIV and consider it our &#8220;content&#8221; container (the &#8220;answer&#8221;)</li>
<li>Slide the answer out of view</li>
<li>Add a click event to the question which will toggle the display of the answer.</li>
</ol>
<h2>Another Take</h2>
<p>The above code is accessible but sacrifices a clean effect during normal page load because you see a &#8220;flicker&#8221; of all of the answers displaying before javascript hides them.  If accessibility is less of a concern and you want a smoother effect, consider adding the following CSS and javascript:</p>
<pre>
#faqs div	{ height:0; overflow:hidden; }
</pre>
<p>&#8230;and the javascript&#8230;</p>
<pre>
window.addEvent('domready',function() {
	$$('#faqs h3').each(function(header,i) {
		var state = false;
		var answer = header.getNext('div');
		answer.slide('out');
		header.addEvent('click',function(e) {
			state = !state;
			answer.slide(state ? 'in' : 'out');
			if(state) {
				header.addClass('active');
			}
			else {
				header.removeClass('active');
			}
		});
		answer.setStyles({
			overflow: '',
			height: 'auto'
		});
	});
});
</pre>
<p>This effect is much smoother.</p>
<div>
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php">View Accessible Demo</a><br />
	<a href="http://davidwalsh.name/dw-content/fancy-faqs-2.php?effect">View Effect Demo</a></p>
<div></div>
</div>
<p>So what do you think?  Would you use this on a customer site?</p>
<div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="left">Send article as PDF to:   </td>
<td align="right"><a href="http://en.pdf24.org" target="_blank" title="PDF Printer"><img src="http://www.neurosoftware.ro/programming-blog/wp-content/plugins/wp-o-matic/cache/ef18f_sheep_16x16.gif" alt="PDF Printer" border="0" /></a></td>
</tr>
</table>
</div>
<p>Don&#8217;t forget to <a href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a href="http://scriptandstyle.com">Script &amp; Style</a> for the best Javascript and CSS articles around!</p>
<p><a href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!</p>
<p><a href="http://davidwalsh.name/fancy-faqs">Fancy FAQs with MooTools Sliders: Version 2</a></p>
<p>Related posts:
<ol>
<li><a href="http://davidwalsh.name/comment-mootools-jquery" rel="bookmark" title="Permanent Link: WordPress-Style Comment Controls Using MooTools or jQuery">WordPress-Style Comment Controls Using MooTools or jQuery</a></li>
<li><a href="http://davidwalsh.name/digg-share-widget" rel="bookmark" title="Permanent Link: Digg-Style Dynamic Share Widget Using MooTools">Digg-Style Dynamic Share Widget Using MooTools</a></li>
<li><a href="http://davidwalsh.name/flashy-faqs-mootools-sliders" rel="bookmark" title="Permanent Link: Flashy FAQs Using MooTools Sliders">Flashy FAQs Using MooTools Sliders</a></li>
<li><a href="http://davidwalsh.name/scrollspy" rel="bookmark" title="Permanent Link: Introducing MooTools ScrollSpy">Introducing MooTools ScrollSpy</a></li>
<li><a href="http://davidwalsh.name/animate-opacity" rel="bookmark" title="Permanent Link: Sexy Opacity Animation with MooTools or jQuery">Sexy Opacity Animation with MooTools or jQuery</a></li>
</ol>
<p><a href="http://davidwalsh.name/feed/atom">Go to Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neurosoftware.ro/programming-blog/blogposter/web-resources/fancy-faqs-with-mootools-sliders-version-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

