<?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>Richard O&#039;Neill &#187; AJAX</title>
	<atom:link href="http://richardoneill.com.au/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://richardoneill.com.au</link>
	<description>Design, Develepment and Photography</description>
	<lastBuildDate>Thu, 29 Dec 2011 09:05:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Draggable Windows with Javascript</title>
		<link>http://richardoneill.com.au/2007/07/draggable-windows-with-javascript/</link>
		<comments>http://richardoneill.com.au/2007/07/draggable-windows-with-javascript/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 16:22:35 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[A window is essentially just a floating div. We can make the div draggable using the Script.aculo.us Javascript library. First, we need to create the window div. Here is the CSS I used. .window { &#160;&#160;background: #d8e7fe; &#160;&#160;position: absolute; &#160;&#160;top: 200px; &#160;&#160;left: 200px; &#160;&#160;width: 350px; &#160;&#160;padding: 1px; &#160;&#160;-moz-border-radius: 7px; &#160;&#160;border: 2px solid #21416d; } .window [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="/misc/jswindow.html"><img src="/img/articles/jswindow.jpg" alt="Javascript Window" /></a>
<p>A window is essentially just a floating div. We can make the div draggable using the <a href="http://script.aculo.us">Script.aculo.us</a> Javascript library.</p>
<p>First, we need to create the window div. Here is the CSS I used.</p>
<p><code><br />
.window {<br />
&nbsp;&nbsp;background: #d8e7fe;<br />
&nbsp;&nbsp;position: absolute;<br />
&nbsp;&nbsp;top: 200px;<br />
&nbsp;&nbsp;left: 200px;<br />
&nbsp;&nbsp;width: 350px;<br />
&nbsp;&nbsp;padding: 1px;<br />
&nbsp;&nbsp;-moz-border-radius: 7px;<br />
&nbsp;&nbsp;border: 2px solid #21416d;</p>
<p>}<br />
.window h1 {<br />
&nbsp;&nbsp;-moz-border-radius-topleft: 5px;<br />
&nbsp;&nbsp;-moz-border-radius-topright: 5px;<br />
&nbsp;&nbsp;padding: 6px;<br />
&nbsp;&nbsp;display: block;<br />
&nbsp;&nbsp;background-color: #9cc6ff;<br />
&nbsp;&nbsp;font-size: 13px;<br />
&nbsp;&nbsp;margin: 0px;<br />
}<br />
</code>
<p>And here is the HTML markup.</p>
<p><code><br />
&lt;div id="mywindow" class="window"&gt;<br />
&nbsp;&nbsp;&lt;h1&gt;Example Window&lt;/h1&gt;<br />
&nbsp;&nbsp;&lt;p&gt;Click and drag this window around the webpage.&lt;/p&gt;<br />
&lt;/div&gt;<br />
</code>
<p>I&#8217;ve used &#8216;<a href="http://developer.mozilla.org/en/docs/CSS:-moz-border-radius">-moz-border-radius</a>&#8216; for rounded corners because I&#8217;m lazy. You&#8217;ll need to use corner images if you want rounded corners that work in more than one browser.</p>
<p>Now all that&#8217;s left to do is the javascript. As I said before, we&#8217;ll use the <a href="http://script.aculo.us">Script.aculo.us</a> library which includes a handy Draggable function. Theres a quick guide on how to install the library <a href="http://wiki.script.aculo.us/scriptaculous/show/Usage">here</a>.</p>
<p>Once you&#8217;ve got the library installed, add this short Javascript snippet to the <em>head</em> section of your document.</p>
<p><code><br />
&lt;script type="text/javascript"&gt;</p>
<p>	function init(){<br />
	&nbsp;&nbsp;new Draggable('mywindow');<br />
	}</p>
<p>	Event.observe(window, 'load', init, false);</p>
<p>&lt;/script&gt;</code>
<p>When the page loads, the init() function is called, which tells the library to make the div &#8216;mywindow&#8217; draggable!</p>
<p><strong><a href="/misc/jswindow.html">View the finished product.</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://richardoneill.com.au/2007/07/draggable-windows-with-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Password Strength Meter</title>
		<link>http://richardoneill.com.au/2007/07/password-strength-meter/</link>
		<comments>http://richardoneill.com.au/2007/07/password-strength-meter/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 16:38:19 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Making a password strength meter is simple, there&#8217;s no tricky Javascript or AJAX needed, just a simple function and a few divs. Click to view demo. I&#8217;ve decided to design the function around a scoring system, the stronger the password the higher the score. We can accomplish this with just a few simple IF statements. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Making a password strength meter is simple, there&#8217;s no tricky Javascript or AJAX needed, just a simple function and a few divs.</p>
<p><a href="/misc/passwordstrengthmeter.html"><img src="/img/articles/passwordstrengthmeter.jpg" alt="Password Strength Meter" /><br />Click to view demo.</p>
<p></a>
<p>I&#8217;ve decided to design the function around a scoring system, the stronger the password the higher the score. We can accomplish this with just a few simple IF statements.</p>
<p><code>function passwordStrength(pass)<br />
{</p>
<p>	var score = 0;</p>
<p>	if(pass.length &gt; 2)<br />
		score++;</p>
<p>	if(pass.length &gt; 4)<br />
		score++;</p>
<p>	if(pass.length &gt; <img src='http://richardoneill.com.au/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /><br />
		score += 2;</p>
<p>	if(/w/.test(pass) &#038;&#038; /d/.test(pass))<br />
		score++;</p>
<p>	return score * 2 * 10;</p>
<p>}</code>
<p>The code is fairly self explanatory, the last IF statement checks if the password contains both characters and symbols. The function returns a percentage of the password&#8217;s score out of 5, which is the maximum score it can be awarded.</p>
<p>Next, we need a form with a text box and 2 divs for our meter.</p>
<p><code><br />
&lt;input type="text" onkeyup="document.getElementById('passmeter').style.width = passwordStrength(this.value) + '%';" /&gt;<br />
&lt;br /&gt;<br />
Password Strength:&lt;br /&gt;<br />
&lt;div id="passmeterbg"&gt;&lt;div id="passmeter"&gt;&lt;/div&gt;&lt;/div&gt;<br />
</code>
<p>The &#8216;onkeyup&#8217; event calls the passwordStrength() function every time a key is pressed. The &#8216;width&#8217; property of our meter div is then given the password&#8217;s score.</p>
<p>Finally, we need some CSS to style the meter&#8230;</p>
<p><code><br />
			#passmeter {<br />
				width: 0px;<br />
				background: #629d48;<br />
				height: 3px;<br />
			}</p>
<p>			#passmeterbg {<br />
				height: 3px;<br />
				background: #f1f1f1;<br />
				width: 200px;<br />
			}<br />
</code>
<p><a href="/misc/passwordstrengthmeter.html" style="font-weight: bold;">View the finished product.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://richardoneill.com.au/2007/07/password-strength-meter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use AJAX Sparingly</title>
		<link>http://richardoneill.com.au/2007/06/use-ajax-sparingly/</link>
		<comments>http://richardoneill.com.au/2007/06/use-ajax-sparingly/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 15:40:17 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[AJAX is a only great technique when used in moderation. It belongs in forms and page widgets, but should never be used for navigational purposes. Call me a traditionalist, but webpages are pages, not desktop applications. Changing the way a UI component works on your website is unnecessary and confusing for your users. Normal links [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="/img/articles/appwindow.jpg" style="float: left;" alt="AJAX" />
<p>AJAX is a only great technique when used in moderation. It belongs in forms and page widgets, but should never be used for navigational purposes. </p>
<p>Call me a traditionalist, but webpages are pages, not desktop applications. Changing the way a UI component works on your website is unnecessary and confusing for your users.</p>
<p>Normal links shouldn&#8217;t change page content without warning and pages shouldn&#8217;t extend when you reach the bottom.</p>
<p>Use AJAX sparingly if you want to make a better user experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://richardoneill.com.au/2007/06/use-ajax-sparingly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

