<?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>dingobytes</title>
	<atom:link href="http://www.dingobytes.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dingobytes.com</link>
	<description>what your nephew can't make you</description>
	<lastBuildDate>Sat, 06 Feb 2010 23:43:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Funny E*Trade commercial</title>
		<link>http://www.dingobytes.com/humor/funny-etrade-commercial</link>
		<comments>http://www.dingobytes.com/humor/funny-etrade-commercial#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:12:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[baby]]></category>
		<category><![CDATA[commercial]]></category>
		<category><![CDATA[E*Trade]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=103</guid>
		<description><![CDATA[Just too funny!

]]></description>
			<content:encoded><![CDATA[<p>Just too funny!</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/uHPg262Kr9c&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/uHPg262Kr9c&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/humor/funny-etrade-commercial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show Message 1.0- jQuery Plugin for displaying messages</title>
		<link>http://www.dingobytes.com/tutorial/show-message-1-0-jquery-plugin-for-displaying-messages</link>
		<comments>http://www.dingobytes.com/tutorial/show-message-1-0-jquery-plugin-for-displaying-messages#comments</comments>
		<pubDate>Mon, 01 Feb 2010 02:26:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[notification box]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=90</guid>
		<description><![CDATA[Inspired by a similar feature at Twitter.com, this jQuery Plugin will help you display messages at the top of your page with an assortment of options.
Download the latest version 1.3 of the plugin at http://showMessage.dingobytes.com/download/
This is my first attempt at a jQuery Plugin, so although it works fine for my liking, I am sure there [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by a similar feature at Twitter.com, this jQuery Plugin will help you display messages at the top of your page with an assortment of options.</p>
<p style="border:medium #06f solid;width:95%;padding:0.5em;font-size:x-large;text-align:center;">Download the latest version 1.3 of the plugin at <a href="http://showMessage.dingobytes.com/download/" title="download">http://showMessage.dingobytes.com/download/</a></p>
<p>This is my first attempt at a jQuery Plugin, so although it works fine for my liking, I am sure there are many things that can be done more effectively.</p>
<ul>
<li>Message displayed at the top of page (no scrolling to view error)</li>
<li>Multiple messages can be displayed</li>
<li>Options to automatically close the message after set delay</li>
<li>Message closes with blur/&#8217;esc&#8217; key/&#8217;close&#8217; link</li>
</ul>
<ul>
<li><a title="Download" href="#download">Download</a></li>
<li><a title="Install" href="#install">Install</a></li>
<li><a title="Options" href="#options">Options</a></li>
<li><a title="Examples" href="#examples">Examples</a></li>
</ul>
<div id="download">
<h2><span id="more-90"></span>Download</h2>
<p style="border: medium #06f solid; width: 95%; padding: 0.5em; font-size: x-large; text-align: center;"><a title="download now" href="http://showMessage.dingobytes.com/download/" target="_blank">Download showMessage 1.1</a></p>
</div>
<div id="install">
<h2>Install</h2>
<p>You can install showMessage jQuery Plugin by including the script somewhere in the page AFTER jQuery. This plugin should work on jQuery version 1.3.2+.</p>
<pre class="brush: html">&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/jquery.showMessage.min.js&quot;
charset=&quot;utf-8&quot;&gt;&lt;\/script&gt;</pre>
<p>If you wish to style the text, the message is displayed through an unordered list in the div with id attribute=showMessage</p>
<pre class="brush: css">#showMessage li
{
font-family: Arial, Helvetica, clean, sans-serif;
font-size: large;
font-weight: bold;
color: red;
}</pre>
</div>
<div id="options">
<h2>Options</h2>
<p>Here are the possible options with their default values:</p>
<pre class="brush: javascript">
thisMessage:		[&#039;&#039;],
backgroundColor:	&#039;#F7F7F7&#039;,
color:			&#039;#000000&#039;,
opacity:		90,
displayNavigation:	true,
autoClose:		false,
delayTime:		5000
</pre>
<dl>
<dt>thisMessage <em>(required)</em><span class="alignright">[Array]</span></dt>
<dd>The message you will be returning to the page. The message is in the form of an array.</dd>
<dt>blackgroundColor<span class="alignright">[string]</span></dt>
<dd>Default set to &#8216;#F7F7F7&#8242;. The background color of the message holder. (&#8216;#F7F7F7&#8242; or &#8216;rgb(247, 247, 247)&#8217; or &#8216;white&#8217;)</dd>
<dt>color<span class="alignright">[string]</span></dt>
<dd>Default set to &#8216;#000000&#8242;. The font color in the message holder. (&#8216;#000000&#8242; or &#8216;rgb(0, 0, 0)&#8217; or &#8216;black&#8217;)</dd>
<dt>opacity<span class="alignright">[integer]</span></dt>
<dd>Default set to 90. Opacity of the message holder. Value is an integer between 1 and 100.</dd>
<dt>displayNavigation<span class="alignright">[boolean]</span></dt>
<dd>Default set to true. Will display the &#8216;esc&#8217; and &#8216;close&#8217; information in upper right.</dd>
<dt>autoClose<span class="alignright">[boolean]</span></dt>
<dd>Default is set to false. When set to true, it will close the message holder after specified delay time.</dd>
<dt>delayTime<span class="alignright">[integer]</span></dt>
<dd>Default is set to 5000. Amount of time in milli-seconds before the message holder will close/hide (autoClose must be set to true).</dd>
</dl>
</div>
<div id="examples">
<h2>Example</h2>
<dl>
<dt>Simple</dt>
<dd> Just return a simple message to message holder.</p>
<pre class="brush: javascript">
jQuery.showMessage({
&#039;thisMessage&#039;:[&#039;&lt;mg src=&quot;/images/accept.png&quot; alt=&quot;accept&quot;/&gt;successful!&#039;]
});
</pre>
</dd>
<dt>Advanced</dt>
<dd> This should look a lot like Twitter.</p>
<pre class="brush: javascript">
var returnMessage = [&#039;Account was created successfully!&#039;,&#039;Thank you.&#039;];
jQuery.showMessage({
&#039;thisMessage&#039;:		returnMessage,
&#039;backgroundColor&#039;:	&#039;#f7f7f7&#039;,
&#039;color&#039;:		&#039;black&#039;,
&#039;opacity&#039;:		95,
&#039;displayNavigation&#039;:	false,
&#039;autoClose&#039;:		true,
&#039;delayTime&#039;:		6000
});
</pre>
</dd>
</dl>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/tutorial/show-message-1-0-jquery-plugin-for-displaying-messages/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Deleted scenes from Halloween</title>
		<link>http://www.dingobytes.com/humor/deleted-scenes-from-halloween</link>
		<comments>http://www.dingobytes.com/humor/deleted-scenes-from-halloween#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:29:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[deleted]]></category>
		<category><![CDATA[Halloween]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=87</guid>
		<description><![CDATA[Michael Myers Is Way Cooler in &#8216;Halloween&#8217;s&#8217; Deleted Scenes &#8212; powered by Cracked.com
]]></description>
			<content:encoded><![CDATA[<div><object type="application/x-shockwave-flash" data="http://cdn-i.dmdentertainment.com/DMVideoPlayer/player.swf" id="player" height="344" width="425" ><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="movie" value="http://cdn-i.dmdentertainment.com/DMVideoPlayer/player.swf" /><param name="wmode" value="transparent" /><param name="flashVars" value="v=2.2.0&#038;DESC=%3Cp%3EApparently%20Michael%20Meyers%20was%20pretty%20chill%20in%20the%20original%20cut.%3C/p%3E%0A%3Cp%3ECheck%20out%20more%20from%20%3Ca%20target%3D%22c%22%20href%3D%22http%3A//fatawesome.com/%22%3EFatAwesome.com%3C/a%3E.&#038;demand_preroll=false&#038;video_title=Michael%20Myers%20Is%20Way%20Cooler%20in%20%27Halloween%27s%27%20Deleted%20Scenes&#038;demand_preroll_source=http%3A//cdn-www.cracked.com/sites/cracked2/images/videoplayer/Pre-Roll1b.swf&#038;KEYWORDS=&#038;adPartner=Adap&#038;demand_iconurl=http%3A//cdn-www.cracked.com/sites/cracked2/images/favicon.gif&#038;COMPANION_DIV_ID=adaptv_ad_companion_div&#038;demand_autoplay=0&#038;KEY=DemandMediacracked&#038;demand_icontext=Watch%20more%20videos%20at%20Cracked.com%2C%20America%27s%20only%20humor%20site.&#038;demand_iconlink=http%3A//www.cracked.com/&#038;height=37&#038;CATEGORIES=Movies%20%26%20TV&#038;sitename=Cracked.com&#038;source=http%3A//cdn-www.cracked.com/phpimages/videos/7/3/7/7737_608X342.flv&#038;demand_report_url=http%3A//www.cracked.com/update.aspx&#038;URL=http%3A//cdn-www.cracked.com/phpimages/videos/7/3/7/7737_608X342.flv&#038;demand_content_sourcekey=cracked.com&#038;skin=http%3A//cdn-i.dmdentertainment.com/DMVideoPlayer/playerskin.swf&#038;TITLE=Michael%20Myers%20Is%20Way%20Cooler%20in%20%27Halloween%27s%27%20Deleted%20Scenes&#038;demand_show_replay=true&#038;ID=16741&#038;demand_content_id=16741&#038;demand_related=1&#038;demand_page_url=http%3A//www.cracked.com/video_16741_michael-myers-way-cooler-in-halloweens-deleted-scenes.html&#038;demand_related_feed=http%3A//www.cracked.com/relatedvideo_16741_michael-myers-way-cooler-in-halloweens-deleted-scenes.xml" /></object><br /><a href="http://www.cracked.com/video_16741_michael-myers-way-cooler-in-halloweens-deleted-scenes.html">Michael Myers Is Way Cooler in &#8216;Halloween&#8217;s&#8217; Deleted Scenes</a> &#8212; powered by Cracked.com</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/humor/deleted-scenes-from-halloween/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worth a good look</title>
		<link>http://www.dingobytes.com/technology/worth-a-good-look</link>
		<comments>http://www.dingobytes.com/technology/worth-a-good-look#comments</comments>
		<pubDate>Wed, 14 Oct 2009 16:19:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[touch screen]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=84</guid>
		<description><![CDATA[Was talking to some of my &#8220;geek&#8221; friends about touch technology and some of the reasons why it will not the &#8220;wave of the future&#8221;. Then Zac shows me this from his great blog.
http://randomonium.blog-o-blog.com/post/211379921/multi-touch-desktop-interface-want-it-now/This is not the answer to all the issues with touch technology, but it is addressing some of the biggest issues and [...]]]></description>
			<content:encoded><![CDATA[<p>Was talking to some of my &#8220;geek&#8221; friends about touch technology and some of the reasons why it will not the &#8220;wave of the future&#8221;. Then Zac shows me this from his great blog.</p>
<p>http://randomonium.blog-o-blog.com/post/211379921/multi-touch-desktop-interface-want-it-now/<span id="more-84"></span>This is not the answer to all the issues with touch technology, but it is addressing some of the biggest issues and is offering some solutions. I don&#8217;t think I would be sold on it as it is presented, but if the hardware and software could be integrated with an OS I like and still work, I would purchase it. Looking at the demo, I definitely believe it would increase efficiency.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="220" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=6712657&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="220" src="http://vimeo.com/moogaloop.swf?clip_id=6712657&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/6712657">10/GUI</a> from <a href="http://vimeo.com/user1415432">C. Miller</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/technology/worth-a-good-look/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery username check</title>
		<link>http://www.dingobytes.com/tutorial/jquery-username-check</link>
		<comments>http://www.dingobytes.com/tutorial/jquery-username-check#comments</comments>
		<pubDate>Tue, 29 Sep 2009 19:04:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=6</guid>
		<description><![CDATA[There are many times we might want to retrieve some data from the server or database without taking the user away from the current page. One such example of this is when a user is registering for a website and they need to verify if a username is available for use or not. Using an [...]]]></description>
			<content:encoded><![CDATA[<p>There are many times we might want to retrieve some data from the server or database without taking the user away from the current page. One such example of this is when a user is registering for a website and they need to verify if a username is available for use or not. Using an AJAX XMLHttpRequest is a quick and efficient way to check the availability of the username. The javascript XMLHttpRequest retrieves information from the server without using a page refresh.</p>
<p><span id="more-6"></span>If you are not familiar with how JavaScript uses a generic XMLHttpRequest function, we would strongly suggest you read one of the many tutorials out there. Once you understand how it works and the different methods employed to do it, you will appreciate the ease of jQuery even that much more.</p>
<p>The first step is to download a current version of <a title="latest jQuery at time of writing" href="http://docs.jquery.com/Release:jQuery_1.3.2" target="_blank">jQuery</a>. We prefer to use the minified version. Another option is to load jQuery into your page is to use the <a title="Google AJAX Libraries API" href="http://code.google.com/apis/ajaxlibs/documentation/" target="_blank">Google AJAX Libraries API</a>. We don&#8217;t use the other AJAX libraries enough to prefer this method, but we have used it in the past for client sites.</p>
<p>Of course we like things to be pretty, so we would also suggest some good images/icons to represent a valid and invalid username. You can create your own image or simply use <a title="Free Icon Set search" href="http://images.google.com/images?hl=en&amp;client=opera&amp;rls=en&amp;um=1&amp;sa=1&amp;q=free+icon+sets&amp;aq=f&amp;oq=&amp;aqi=g1&amp;start=0" target="_blank">Google Images</a> to find a nice free icon set that has something to represent this. We have attached two simple icons that we prefer to use.</p>
<p>To get the document started, we assume that you have jQuery loading somewhere in the head of the document (using which ever method you prefer). We are going to make this simple so we just need to create a form to enter a username. The rules for a username are as follows:</p>
<ol>
<li>Username can not have whitespace</li>
<li>Username must be at least 3 characters long</li>
<li>Username must be no longer then 24 characters long</li>
</ol>
<h2>Simple Registration Form</h2>
<p>
<pre class="brush: html">&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;form id=&quot;registrationForm&quot; action=&quot;/test/registrationForm.php&quot; method=&quot;post&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;legend&gt;Use form below to register&lt;/legend&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dt&gt;&lt;label for=&quot;username&quot;&gt;Username&lt;/label&gt;&lt;/dt&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dd&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;em&gt;Your username must be alphanumeric, 3-24 characters long, can contain underscores, but no spaces. We recommend that you don&#039;t change this unless you really have to.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/dd&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dt&gt;&lt;label for=&quot;passwd&quot;&gt;Password&lt;/label&gt;&lt;/dt&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dd&gt;&lt;input type=&quot;password&quot; id=&quot;passwd&quot; name=&quot;passwd&quot; /&gt;&lt;/dd&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dt&gt;&lt;label for=&quot;passwd-confirm&quot;&gt;Confirm Password&lt;/label&gt;&lt;/dt&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dd&gt;&lt;input type=&quot;password&quot; id=&quot;passwd-confirm&quot; name=&quot;passwd-confirm&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dt&gt;&lt;/dt&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;dd&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;input type=&quot;submit&quot; id=&quot;submitRegistration&quot; value=&quot;Register&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/dd&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
</p>
<p>Now that we have our form setup, we need to do a few things. Obviously we want to check the username when it is entered (or being entered). Second we will want to have some sort of client side validation to save us from processing an incomplete form. Lastly we will want to submit the form and process the response from the server. Whether you use PHP, ASP, ColdFusion or any other method, it is a good practice to validate the form server side as well. We won&#8217;t go into that to much, but is a point worth mentioning.</p>
<p>We prefer to insert the following BEFORE the form. You can put this in a *.js file or you can simply insert it into the page, either works for us. We will need to break the JavaScript into three parts. One function that checks the username, a second function that reads the username input element and initiates username check and a third function to validate and process the form.</p>
<h2>Check Username Function</h2>
<p>
<pre class="brush: jscript">&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
//&lt;![CDATA[&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
function usernameCheck(username)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$.get(&#039;/test/usernameCheck.php&#039;, { &#039;username&#039;:username }, function(xml) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(xml).find(&#039;response&#039;).each( function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var error = $(this).find(&#039;error&#039;).text();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
if ( error == &#039;false&#039; )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var successCheck = $(&#039;&lt;span&gt;&lt;/span&gt;&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
.css({&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&#039;padding-left&#039;:&#039;1em&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
})&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
.html(&#039;&lt;img src=&quot;/test/images/dialog-ok.png&quot; alt=&quot;successful&quot; /&gt;Username is available.&#039;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;input[name=username]&#039;).after(successCheck);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
else&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var errorCheck = $(&#039;&lt;span&gt;&lt;/span&gt;&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
.css({&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&#039;padding-left&#039;:&#039;1em&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
})&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
.html(&#039;&lt;img src=&quot;/test/images/dialog-error-small.png&quot; alt=&quot;error&quot; /&gt;Username is already registered.&#039;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;input[name=username]&#039;).after(errorCheck);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
</p>
<p>The code might look overwhelming right now, but it is actually pretty simple. If we break it down, you will see that the first thing we do inside the  usernameCheck() function is call the jQuery AJAX function <em><a title="jQuery $.get AJAX function" href="http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype" target="_blank">$.get</a></em>. This jQuery function will load a remote page using an HTTP GET request. It only has one requirement (the URL), but also allows for [data], [callback], [type] to be included. We are using both [data] and[callback], with [data] = { &#8216;username&#8217;:username } and [callback] = function(xml). The callback is the function that we want to be executed whenever the data is loaded successfully.</p>
<p>Looking into the function you will see that we are finding each &lt;response&gt; tag in the XML repsponse and inside of that we are looking for the text inside the &lt;error&gt;&lt;/error&gt; node/element of the XML and setting it to the variable &#8220;error&#8221;.</p>
<p>If the XML responds that error is &#8220;false&#8221; we use jQuery to create a &lt;span&gt;&lt;/span&gt; element with image and text response inside of it indicating the username is available. We then insert the new element we have just created after the form input element for username.</p>
<p>The &#8220;else&#8221; is doing the same thing, only it is showing the username is not available.</p>
<p>We will add some more components to this later, but for now lets move to the next functions.  These two functions should be triggered after the page loads, so we will be placing them inside the $(function() {}); element which tells jQuery to load them after the page loads. There are other methods to do this same thing (such as $(document).ready(function(){}); so if you are familiar with jQuery you can use the element you feel most comfortable with.</p>
<h2>Initiate Username Check</h2>
<p>
<pre class="brush: jscript">&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;$(function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var t;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;input[name=username]&#039;).keyup( function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
// REMOVE WHITESPACE FROM USERNAME&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var username = $(&#039;input[name=username]&#039;).val();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
username = username.replace(/\s/g,&#039;&#039;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;input[name=username]&#039;).val(username);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
// IF THE USERNAME VALIDATES, CHECK THE DB&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
if ( username !== &#039;&#039; &amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp; ( username.length &gt;= 3 &amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp; username.length &lt;= 24 ) )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
if ( typeof(t) != &#039;undefined&#039; )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
clearTimeout(t);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
t = setTimeout( function() { usernameCheck(username) }, 750 );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
</p>
<p>You will notice the first variable we define is t. This is going to be used for the setTimeout() function later.</p>
<p>After that declaration you will see we are asking jQuery to watch the keyup event associated with the &#8220;username&#8221; input field and do &#8220;stuff&#8221; after each keystroke. We start  by simply asking for the value of the input field. Then we use the javascript replace() function to strip out any whitespace values followed by reinserting the &#8220;new&#8221; username back into the field.</p>
<p>We don&#8217;t want to even check for the username unless it meets the criteria we mentioned earlier, so we use the if() statement to help us validate that part. If the username is blank or if the username is greater then or equal to 3 characters and the username is less then or equal to 24 characters, then we continue to process the username.</p>
<p>We don&#8217;t want to bombard our server with a request every time a keystroke is made so we use the setTimeout function to  delay the request by a certain amount of time. In order to do this correctly though, we also need to clear the timeout if another keystroke is made within the delay, in effect starting the timeout over again.</p>
<p>Knowing this, we need to give the setTimeout a variable (t) when we call it. Because we know t may or may not exist, we use the if () statement to check for it. If it is defined, we use clearTimeout() function to remove the setTimeout. We can then set the variable t to a fresh setTimeout delay.</p>
<h2>Validate and Submit Form</h2>
<p>When the end user submits the form, we want to validate it and if it passes validation, submit the form. I am not going to go into a lot of detail about this as I have already done similar tutorials (<a title="showMessage tutorial" href="http://www.dingobytes.com/tutorial/showmessage">see here</a>). In a nutshell, we are just making sure the form is filled out and using AJAX to tell us if we were successful/unsuccessful when submitting form.</p>
<p>
<pre class="brush: jscript">&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;$(&#039;#submitRegistration&#039;).click( function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
//validate the form and submit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var username = $(&#039;input[name=username]&#039;).val();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var passwd = $(&#039;input[name=passwd]&#039;).val();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var passwd-confirm = $(&#039;input[name=passwd-confirm]&#039;).val();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var registrationData = $(&#039;#registrationForm).serializeArray();&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;if ( username === &#039;&#039;  || ( username !== &#039;&#039; &amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp; ( username.length &lt; 3 || username.length &gt; 24 ) ) )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
errorMessage.push(&quot;Username must have between 3 and 24 characters.&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
if ( username !== &#039;&#039; &amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp; /\s/.test( username ) )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
errorMessage.push(&quot;Username can not have any spaces.&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
if ( passwd != passwd-confirm )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
errorMessage.push(&quot;Password and Password confirmation do not match.&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;if ( errorMessage.length &gt; 0 )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
showMessage( errorMessage, &quot;error&quot;, &quot;alert&quot; );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
return false;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
else&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$.post(&#039;/test/registrationForm.php&#039;, registrationData, function(xml) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(xml).find(&#039;response&#039;).each( function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var error = $(this).find(&#039;error&#039;).text();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var returnMessageString = $(this).find(&#039;returnMessage&#039;).text();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
var returnMessage = [];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
if ( error == &#039;false&#039; )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
returnMessage.push(returnMessageString);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
showMessage( returnMessage, &quot;highlight&quot;, &quot;info&quot; );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
else&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
returnMessage.push(returnMessageString);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
showMessage( returnMessage, &quot;error&quot;, &quot;alert&quot; );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
return false;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
</p>
<p>So that is our start. You will notice if you run this code that it fails to work properly. What we don&#8217;t have is a way to clear out the &#8220;response&#8221; if it already exists on the page. Because we know where the response should be, we can create a simple check for the response and if it is found, remove it.  You will need to do this in both the usernameCheck function and also the function that sets the timeout.</p>
<p>
<pre class="brush: jscript">&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;if ( $(&#039;input[name=username]&#039;).next(&#039;span&#039;).length )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;input[name=username]&#039;).next(&#039;span&#039;).remove();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
</p>
<p>Using the length of an element is how we check for the elements existence when using jQuery. Once we find that it does exist, we remove the entire element using the jQuery remove() function.</p>
<p>Lastly, jQuery has some features built in that make our forms prettier. I like to use animation to soften the effect of having elements just appearing BLAM! on the page. We can add a slow fade in effect to the username check to ease the message on the page . We add a diplay=none style to the span and then trigger the jQuery fadeIn() effect to achieve this.</p>
<p>
<pre class="brush: jscript">&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;var successCheck = $(&#039;&lt;span&gt;&lt;/span&gt;&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
.css({&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&#039;display&#039;:&#039;none&#039;,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&#039;padding-left&#039;:&#039;1em&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
})&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
.html(&#039;&lt;img src=&quot;/test/images/dialog-ok.png&quot; alt=&quot;successful&quot; /&gt;Username is available.&#039;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;input[name=username]&#039;).after(successCheck);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(successCheck).fadeIn(&#039;slow&#039;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
</p>
<p>There you have it, a nice jQuery username check.  You can test this out here or you can download the files (all zipped up) and give it a try yourself.</p>
<p><a title="usernameCheck.zip" href="http://dingobytes.com/example/usernameCheck.zip">usernameCheck.zip</a> (124KB)<br />
<a title="usernameCheck.rar" href="http://dingobytes.com/example/usernameCheck.rar">usernameCheck.rar</a> (117KB)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/tutorial/jquery-username-check/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing applications with KISS</title>
		<link>http://www.dingobytes.com/development/developing-applications-with-kiss</link>
		<comments>http://www.dingobytes.com/development/developing-applications-with-kiss#comments</comments>
		<pubDate>Tue, 11 Aug 2009 01:53:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[KISS]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=68</guid>
		<description><![CDATA[When it comes to developing new applications for the web, it doesn&#8217;t take long for plans to spiral out of control. The development track usually starts off simple, but somewhere between initial planning and final release there is this thing we here like to call &#8220;Feature Creep&#8221;.
What might start off as a simple idea is [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to developing new applications for the web, it doesn&#8217;t take long for plans to spiral out of control. The development track usually starts off simple, but somewhere between initial planning and final release there is this thing we here like to call &#8220;Feature Creep&#8221;.</p>
<div class="wp-caption alignleft" style="width: 372px"><a href="http://stuffthathappens.com/blog/"><img title="Our Application" src="http://www.talkingtext.com/wordpress_en/wp-content/uploads/2008/04/googleproduct.jpg" alt="our application vs. good application" width="362" height="700" /></a><p class="wp-caption-text">our application vs. good application</p></div>
<p>What might start off as a simple idea is turned into a three headed monster as more people add their input. The longer it takes the application to be completed, the more features are added to it until the next thing you know, the application has forms, polls, feedback, email to a friend, embed, etc all added to this small 300 x 300 pixel box.<span id="more-68"></span>There are some steps that can make your product more user friendly and have a clean finished product. So just how do you make such a product? Well here are just a few ideas we have that might help you create a useful end product.</p>
<ol>
<li>Step one is one you have heard before, we are sure. When you create the product follow the KISS (Keep It Simple Stupid) philosophy during the planning stages. Keeping the product simple helps speed the development, keeps the product focused on its core purpose and gives a good base foundation for the future of the product.</li>
<li> Make the product scalable. When ever possible, try to think about how this product can be built to allow it to grow. Keep in mind server, database, and client side concerns that might affect the product when it becomes an world wide sensation. If you can design a product that is scalable, it has the chance to have a much longer product life as well.</li>
<li>Stick to the original plan. If the project was well thought out, it should be flexible and grow as the product grows. If during the development, there are new ideas, don&#8217;t change the development path to include those. If the ideas are important they can be included in future versions of the product.</li>
<li> Use technology wisely. AJAX is useful, but it doesn&#8217;t mean the entire site has to be created using JavaScript. Some web users may be using applications that do not have JavaScript and would be left out of the experience. The product should gracefully degrade when necessary. Use client side and server side validation.</li>
</ol>
<p>The end user has an important role with the products development. Let users know you want their constructive criticism of the product (and not just that it sucks). Have them be specific as to what they like and do not like about the product. It doesn&#8217;t mean every idea is a great idea, but listening can help you develop a better product.</p>
<p>So keeping your product simple, scalable and relevant can do more then just save you time, but also make your product more useful to the end user.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/development/developing-applications-with-kiss/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My JavaScript Tool Kit</title>
		<link>http://www.dingobytes.com/javascript/my-javascript-tool-kit</link>
		<comments>http://www.dingobytes.com/javascript/my-javascript-tool-kit#comments</comments>
		<pubDate>Wed, 04 Mar 2009 00:21:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=62</guid>
		<description><![CDATA[I have put together a “tool” kit of sorts to help anyone who is just starting out with scripting with javascript. I used javascript sparingly the first few years that I was scripting web applications and sites and it wasn&#8217;t until the last year that I really became infatuated with the scripting language.
My understanding of [...]]]></description>
			<content:encoded><![CDATA[<p>I have put together a “tool” kit of sorts to help anyone who is just starting out with scripting with javascript. I used javascript sparingly the first few years that I was scripting web applications and sites and it wasn&#8217;t until the last year that I really became infatuated with the scripting language.</p>
<p>My understanding of javascript has increased as I have scoured google.com looking for functions and frameworks to fulfill my page or project needs, but I still feel there is a lot more to learn. I have decided to create this list to help anyone who might just be starting out and needs some direction.<span id="more-62"></span></p>
<ol>
<li>Pick up a copy of “DOM Scripting: Web Design with JavaScript and the Document Object Model” by Jeremy Keith. This book is not easy enough to understand, but it also reminds new javascript users about graceful degradation. Before using any framework, I used many of the scripts in the book religiously. (find the book at http://www.friendsofed.com/book.html?isbn=9781590595336)</li>
<li>Use good web developer tools. Depending on your browser, make sure you are using web developer tools and checking for errors. Firebug is very popular for Firefox browser, but I still prefer the Web Developer tool bar. Microsoft offers a web developer tool bar for free download as well, but this does not have any javascript debugging included. You will need to enable javascript debugging in the IE browser and I would suggest downloading the Microsoft Debugging tool. (Firefox Web Developer: https://addons.mozilla.org/en-US/firefox/addon/60, Firefox Firebug: https://addons.mozilla.org/en-US/firefox/addon/1843 and Microsoft Script Debugger: http://www.microsoft.com/Downloads/details.aspx?familyid=2F465BE0-94FD-4569-B3C4-DFFDF19CCD99&amp;displaylang=en)</li>
<li>Never depend on javascript. Good mark up will always gracefully degrade so that the end product is accessible and usable.</li>
<li>Use the javascript validator at http://jslint.com. Douglas Crockford knows his javascript and his validator (even though it is strict) will help you write good script.</li>
<li>Once your javascript validates, you can minify your script using one of the many javascript compressor/minification tools available. I have used http://javascriptcompressor.com/ with the Base62 encode and shrink variables checked and it has worked well. Another that I just started using is Closure Compiler found here: http://code.google.com/closure/compiler/</li>
<li>Once you are comfortable with javascript, use a framework to speed development. There are several frameworks available such as Jquery, YUI, Prototype, Dojo, Mootools, etc. Find the framework that best suits your needs and learn to use it.</li>
</ol>
<p>I hope this toolkit will help you create accessible and usable applications. I might add to it as I think of more, but this is a great start (I know I wish I would have had it to start with).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/javascript/my-javascript-tool-kit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>showMessage</title>
		<link>http://www.dingobytes.com/tutorial/showmessage</link>
		<comments>http://www.dingobytes.com/tutorial/showmessage#comments</comments>
		<pubDate>Tue, 28 Oct 2008 03:47:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[message]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=21</guid>
		<description><![CDATA[Having to mess with forms all the time, I was beginning to go crazy tweeking different messages. One for success, one for failure, one for help, etc.
I decided to try to combine some css with some javascript to make a nice reusable piece to display my form messages. Here is the fruit of that labor.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Having to mess with forms all the time, I was beginning to go crazy tweeking different messages. One for success, one for failure, one for help, etc.</p>
<p>I decided to try to combine some css with some javascript to make a nice reusable piece to display my form messages. Here is the fruit of that labor.</p>
<p>The function is going to take three arguments. The first argument is a message and or list of messages. The second is the id of the node you would like to stick the message before. The last argument is a classname.</p>
<p><span id="more-21"></span></p>
<pre class="brush: javascript">
/*global document */
function showMessage(thismessage, location_id, classname) {
//first clear showmessage div
if (document.getElementById(&quot;showmessage&quot;)) {
var clearerror = document.getElementById(&quot;showmessage&quot;);
clearerror.parentNode.removeChild(clearerror);
}
</pre>
<p>The first part of the function will check to see if the div “showmessage” exists. If it does then it will remove it from the document.</p>
<pre class="brush: javascript">
// create an showmessage div
var location = document.getElementById(location_id);
</pre>
<p>We define the location so it can be used later. Below we create a new div and set the id attribute to showmessage. We then can style the div for each instance using the className. After that we create an unordered list.</p>
<p>With the list ready, the messages can then be put into an array. We will split the messages up in this example with a pipe &#8220;|&#8221;.  You can substitute your own delimiter.</p>
<pre class="brush: javascript">
var showmessagediv = document.createElement(&quot;div&quot;);
showmessagediv.setAttribute(&quot;id&quot;, &quot;showmessage&quot;);
showmessagediv.className = classname;
var showmessageul = document.createElement(&quot;ul&quot;);
showmessageul.setAttribute(&quot;id&quot;, classname + &quot;list&quot;);
var showmessage = [];
showmessage = thismessage.split(&quot;|&quot;);
var i;
for (i = 0; i &lt; showmessage.length; i++) {
var showmessageli = document.createElement(&quot;li&quot;);
var showmessagelitxt = document.createTextNode(showmessage[i]);
showmessageli.appendChild(showmessagelitxt);
showmessageul.appendChild(showmessageli);
}
showmessagediv.appendChild(showmessageul);
location.parentNode.insertBefore(showmessagediv, location);
// have to add this to display error until css corrected
}
</pre>
<p>Looping through the array, we create a new list element and insert the message. We append the message to the new list element and then append the list element to the unordered list element. When it is all done then we append the unordered list to the showmessage div. The last step of the function is to insert the new showmessage div right before the location_id.</p>
<p>Attached is the style I used with both the successful messages and the unsuccessfull images.</p>
<pre class="brush: css">
.errormsg {
clear: both;
display: block;
width: 90%;
color: #FFFFFF;
font-weight: bold;
background-color: #FF9D9D;
padding: 9px 10px 6px 40px;
margin: 10px 0;
border: 2px solid #FF0000;
}

.successmsg {
clear: both;
display: block;
width: 90%;
color: #333333;
font-weight: bold;
background-color: #9bc19b;
padding: 9px 10px 6px 40px;
margin: 10px 0;
border: 2px solid #039b03;
}

#errormsglist, #successmsglist {
margin-left: 0;
padding-left: 0;
list-style: none;
}

#errormsglist li, #successmsglist li{
padding-left: 20px;
background-repeat: no-repeat;
background-position: 0;
}

#errormsglist li { background-image: url(/icon/exclamation.png); }

#successmsglist li { background-image: url(/icon/accept.png); }
</pre>
<p>You can modify the CSS and change the class name to what ever you wish. The only think to remember is if you style the list, to append &#8220;list&#8221; to the style.</p>
<p><a href="http://www.dingobytes.com/wp-content/uploads/2008/11/showmessage.js">showMessage.js</a></p>
<p><a href="http://www.dingobytes.com/wp-content/uploads/2008/10/showmessage.css">showMessage.css<br />
</a></p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 26px"><a href="http://www.dingobytes.com/wp-content/uploads/2008/10/exclamation.png"><img class="size-medium wp-image-28" title="exclamation.png" src="http://www.dingobytes.com/wp-content/uploads/2008/10/exclamation.png" alt="exclamation.png" width="16" height="16" /></a><p class="wp-caption-text">exclamation.png</p></div>
<div id="attachment_27" class="wp-caption alignnone" style="width: 26px"><a href="http://www.dingobytes.com/wp-content/uploads/2008/10/accept.png"><img class="size-medium wp-image-27" title="accept.png" src="http://www.dingobytes.com/wp-content/uploads/2008/10/accept.png" alt="accept.png" width="16" height="16" /></a><p class="wp-caption-text">accept.png</p></div>
<p><a href="http://www.dingobytes.com/wp-content/uploads/2008/10/showmessage.css"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/tutorial/showmessage/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up a new web site on centOS 5 box</title>
		<link>http://www.dingobytes.com/tutorial/web-site-on-centos-5-box</link>
		<comments>http://www.dingobytes.com/tutorial/web-site-on-centos-5-box#comments</comments>
		<pubDate>Sat, 04 Oct 2008 02:43:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[directives]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[VirtualHost]]></category>
		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=16</guid>
		<description><![CDATA[There are so many great tutorials on the web about setting up a Linux box for web hosting, but  why not add one more&#8230; right? Actually this tutorial is written specifically for a co worker that is not familiar with Linux, so this tutorial is being offered to &#8220;assist&#8221; him with the migration process. [...]]]></description>
			<content:encoded><![CDATA[<p>There are so many great tutorials on the web about setting up a Linux box for web hosting, but  why not add one more&#8230; right? Actually this tutorial is written specifically for a co worker that is not familiar with Linux, so this tutorial is being offered to &#8220;assist&#8221; him with the migration process. His old hosting company provided him with CPanel and he is reluctant to change, but who in their right mind would pass up hosting at the price of &#8220;free ninty-nine&#8221;.</p>
<p><span id="more-16"></span>By no means is this a guide for all new linux user, but just a compilation of things learned while setting up web services on a Linux box in the past.</p>
<p>The first step, but not always a necessary step is setting up a new user. This is the preferred way to start as the /etc/skel has been preloaded with all the necessary directories and files to get new users started. If you are going to be a system administrator and you are not familiar with the /etc/skel/, please take some time learn more information about placing files in the /etc/skel/ directory to save time setting up new users. You can put default web directory such as www or public_html plus any other files and or directories you want to give to all new users.</p>
<p>To setup a new user you can simply use the following command (replace username with the username you want to use)</p>
<p><code>adduser -m <em>username</em></code></p>
<p>Now that you have created the account, it is best to setup a password for the account. You can assign  a password to the account using the following command</p>
<p><code>passwd <em>username</em></code></p>
<p>You should be prompted to enter in the new password and then confirm the password. Assume a new account needs to be setup with the username of ditto. When you run the passwd ditto command you should be prompted for the password as follows.</p>
<p><code>Changing password for user ditto.<br />
New UNIX password:<br />
Retype new UNIX password:</code></p>
<p>Your new account is almost ready to start putting files up for the web. One thing to pass along to new system administrators is that you have to make sure you setup the right permissions on this new account so it is strongly suggested that you do this now.</p>
<p>Now the path to the new account may differ depending on your server. Assume for now that new users are setup in the /home/ directory. Assuming your new user &#8220;ditto&#8221; was created successfully, the new account for ditto should be /home/ditto/. Any files in your /etc/skel/ directory would be there as well.  You can check this by using the following command to change directories and list the contents of the directory</p>
<p><code>cd /home/ditto &amp;&amp; ls</code></p>
<p>In this example we have two folders for our user ditto and they are the public_html and wwwconf directories.</p>
<p>To change the permissions on the users ditto directory so it can be viewed by visitors, the permissions on the ditto directory must be changed to something like 755. This can be done to just ditto directory using following command:</p>
<p><code>chmod 755 /home/ditto</code></p>
<p>If you don&#8217;t know what 755 is as far as permissions, pause this tutorial and take the time to <a title="Linux Command Directory: chmod" href="http://www.oreillynet.com/linux/cmd/cmd.csp?path=c/chmod" target="_blank">learn about chmod </a>and what the different permissions will do for you.</p>
<p>Now comes the part where many configurations likely differ depending on what you have installed to run on your server. This tutorial opts to save a core httpd related .conf file in one httpd directory (conf.d) and then from there look for more .conf files in the user directory called wwwconf/. This setup is not the only one possibility in the universe and if you have an older setup or wish to do it differently that is your choice.</p>
<p>You can start your .conf file by copying a current one or creating a new one in your httpd/conf.d/ directory. This tutorial will assume that directory is located at /etc/httpd/conf.d/. Creat your new .conf file in vi or vim by using the following command.</p>
<p><code>sudo vim web.ditto.com.conf</code></p>
<p>This is going to be the core configuration file for your virtualhost. You will need to start the virtualhost using the tag:</p>
<p><code>&lt;VirtualHost *:80&gt;</code></p>
<p>The VirutalHost directive is used to     enclose a group of directives which will apply only to a     particular virtual host. Inside this directive you will put all the information pertaining to your site. You can put the email address to your ServerAdmin, the absolute path to the Document Root, the ServerName and any ServerAlias</p>
<p><code>ServerAdmin webmaster@localhost<br />
Documentroot /home/ditto/public_html/<br />
ServerName www.ditto.com<br />
ServerAlias ditto.com</code></p>
<p>Now it is necessary to give Apache some directives that will apply to our public_html directory. To do this you will create another node inside the VirtualHost node named Directory. The Directory node here is used to enclose     a group of directives which will apply only to the named     directory and sub-directories of that directory (in this case the public_html directory).</p>
<p><code>&lt;Directory /home/ditto/public_html&gt;<br />
Options ExecCGI FollowSymLinks +Includes<br />
&lt;/Directory&gt;</code></p>
<p>This tells Apache that the execution of CGI scripts is permitted, the server will follow symbolic links in this directory, and that server-side includes are permitted.</p>
<p>You will also like to have some type of error log as is very useful when troubleshooting an issue on the box, so be sure to include the following code for error logging. You can access the logs in your httpd/logs directory</p>
<p><code>ErrorLog logs/ditto.error<br />
CustomLog logs/ditto.log combined</code></p>
<p>Now for the customized part. In order to let the user create their own Directory options another Directory directive is created that will point to a folder where other options/modifications can be made by the account user.</p>
<p><code>&lt;Directory /home/ditto/wwwconf&gt;<br />
AllowOverride All<br />
&lt;/Directory&gt;</code></p>
<p>What this does is allows ditto to ftp or ssh into the box and create a .conf file with their own directives and options in the wwwconf/ directory. The directive inside the above tag says any     directive which has the .htaccess context is allowed in .htaccess files. After this tag is closed, it can be followed up with</p>
<p><code>Include /home/ditto/wwwconf/*.conf</code></p>
<p>which tells Apache to grab any file with .conf in the wwwconf/ directory of ditto (if you didn&#8217;t know it already, the &#8220;*&#8221; is a wildcard here).</p>
<p>That should do it. You can now put an end to your VirtualHost node (if you have not already) and your end result should look something like</p>
<p><code>&lt;VirtualHost *:80&gt;<br />
ServerAdmin webmaster@localhost<br />
Documentroot /home/ditto/public_html/<br />
ServerName www.ditto.com<br />
ServerAlias ditto.com<br />
&lt;Directory /home/ditto/public_html&gt;<br />
Options ExecCGI FollowSymLinks +Includes<br />
&lt;/Directory&gt;<br />
ErrorLog logs/ditto.error<br />
CustomLog logs/ditto.log combined<br />
&lt;Directory /home/ditto/wwwconf&gt;<br />
AllowOverride All<br />
&lt;/Directory&gt;<br />
Include /home/ditto/wwwconf/*.conf<br />
&lt;/VirtualHost&gt;</code></p>
<p>You can now save this in the httpd/conf.d/ folder. Now if you want to add a mod re-wite or make a password protected directory in public_html, you can add a .conf file to the wwwconf directory and save my changes there. There is still one more command to use in order for all of this to work and that is the command to restart the httpd service. This can be done very easily using the following command.</p>
<p><code>service httpd restart</code></p>
<p>If you are running on an older system, this command may not be recognized. In those cases you should be able to use</p>
<p><code>/etc/init.d/httpd restart</code></p>
<p>Assuming you didn&#8217;t get any errors when you restarted the httpd service your web service should now be working. If you get an error, be sure to address it right away. Most common issues are invalid paths in the &lt;Directory&gt; tags or missing directories that the &lt;Directory&gt; tags are directed too.</p>
<p>Hopefully this tutorial was helpful to at least one user out there. This tutorial will be followed up next by a tutorial that will help you setup subdomains, create password protected directories and create mod rewrites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/tutorial/web-site-on-centos-5-box/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with sendmail errors</title>
		<link>http://www.dingobytes.com/linux/dealing-with-sendmail-errors</link>
		<comments>http://www.dingobytes.com/linux/dealing-with-sendmail-errors#comments</comments>
		<pubDate>Tue, 19 Aug 2008 07:18:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[550 Banned]]></category>
		<category><![CDATA[failure]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[Service unavailable]]></category>
		<category><![CDATA[smtp auth]]></category>

		<guid isPermaLink="false">http://www.dingobytes.com/?p=9</guid>
		<description><![CDATA[UPDATE: Please disregard all that is below (I was talking out my arse). All was good for some time and then I began getting this error again. After some extensive google searching, I found a lot of articles that indicated that using localhost.localdomain for host would cause the mail to be rejected. I changed my [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #0000ff;"><strong>UPDATE</strong></span>: Please disregard all that is below (I was talking out my arse). All was good for some time and then I began getting this error again. After some extensive google searching, I found a lot of articles that indicated that using localhost.localdomain for host would cause the mail to be rejected. I changed my hosts file (keeping localhost.localdomain localhost of course) and rebooted. Still didn&#8217;t have much luck so I installed sendmail from scratch again using the following instructions from howtoforge and all was good.</p>
<p>http://www.howtoforge.com/configuring-sendmail-to-act-as-a-smarthost-and-to-rewrite-from-address</p>
<p><span style="color: #ff0000;"><strong>Again DO NOT USE THE DESTRUCTIONS BELOW</strong></span></p>
<p>I noticed last week that my emails were not being delivered properly. After taking a look at when the issue started, I realized that it was about the same time I updated my box.</p>
<p>My email was being returned with the reason: 550 Banned rcpt apache@localhost.localdomain. There was also another error 554 5.0.0 Service unavailable. Both of these errors on their own were not to helpful. I asked a friend (the one who sold me the box) to help and he gave me some good advice, but I was unable to resolve the issue and several Google searches didn&#8217;t reveal any solution.</p>
<p><span id="more-9"></span>I checked the maillog in /var/log/ and found that the mail was being sent internally, but I have to use my ISP mail server to actually deliver the messages and this was not happening. The error I found in the mail log that helped was &#8220;stat=Deferred: Temporary AUTH failure&#8221;. I was able to find the resolution to the issue right on the Sendmail.org site.</p>
<p>I use my sendmail as a client and up until last week I never had any issue with the setup I was using. I am still not sure if I began having an issue with sendmail because it was updated or if it was just my ISP found the security issue with the way I was using it, but eithr way, it stopped working correctly.</p>
<p>Here is the error:</p>
<p><code>----- The following addresses had permanent fatal errors -----<br />
&lt;apache@localhost.localdomain&gt;<br />
(reason: 550 Banned rcpt apache@localhost.localdomain *@localhost.localdomain)</code></p>
<p><code>----- Transcript of session follows -----<br />
... while talking to mail.cableone.net.:<br />
&gt;&gt;&gt; RCPT To:&lt;apache@localhost.localdomain&gt;<br />
&lt;&lt;&lt; 550 Banned rcpt apache@localhost.localdomain *@localhost.localdomain<br />
550 5.1.1 &lt;apache@localhost.localdomain&gt;... User unknown</code></p>
<p><code>Final-Recipient: RFC822; apache@localhost.localdomain<br />
Action: failed<br />
Status: 5.1.1<br />
Remote-MTA: DNS; mail.cableone.net<br />
Diagnostic-Code: SMTP; 550 Banned rcpt apache@localhost.localdomain *@localhost.localdomain<br />
Last-Attempt-Date: Mon, 18 Aug 2008 21:45:23 -0500</code></p>
<p><code>---------- Forwarded message ----------<br />
From: Mail Delivery Subsystem &lt;MAILER-DAEMON&gt;<br />
To: &lt;apache@localhost.localdomain&gt;<br />
Date: Mon, 18 Aug 2008 20:45:31 -0500<br />
Subject: Returned mail: see transcript for details<br />
----- The following addresses had permanent fatal errors -----<br />
&lt;support@cityofdilworth.com&gt;<br />
(reason: 550 Banned from (apache@localhost.localdomain) (*@localhost.localdomain))</code></p>
<p><code>----- Transcript of session follows -----<br />
... while talking to mail.cableone.net.:<br />
&gt;&gt;&gt; MAIL From:&lt;apache@localhost.localdomain&gt; SIZE=1521<br />
&lt;&lt;&lt; 550 Banned from (apache@localhost.localdomain) (*@localhost.localdomain)<br />
554 5.0.0 Service unavailable</code></p>
<p><code>Final-Recipient: RFC822; support@cityofdilworth.com<br />
Action: failed<br />
Status: 5.0.0<br />
Diagnostic-Code: SMTP; 550 Banned from (apache@localhost.localdomain) (*@localhost.localdomain)<br />
Last-Attempt-Date: Mon, 18 Aug 2008 20:45:31 -0500</code></p>
<p><code>---------- Forwarded message ----------</code></p>
<p>To resolve the issue, simply follow the instructions to setup SMTP AUTH that were provided by Benji Fisher. To start, log onto your machine as <code>root</code>.</p>
<ol>
<li>Change directory to where your sendmail configuration files <code>(sendmail.mc</code> and <code>sendmail.cf</code>) are located, usually<code> /etc/mail/</code></li>
<li>Create a safe subdirectory (suggested name <code>auth/</code>):<code># mkdir auth<br />
# chmod 700 auth</code></li>
<li>Create a file with your authentication information (suggested name <code>auth/client-info</code>):<br />
<code>AuthInfo:your.isp.net "U:root" "I:user" "P:password"</code></p>
<p>filling in your ISP&#8217;s mail server, your user name, and your password. (Note: Earthlink, and perhaps other ISP&#8217;s, requires your full e-mail address as a user name.)</li>
<li>Generate the authentication database and make both files readable only by <code>root</code>:<br />
<code># cd auth<br />
# makemap hash client-info &lt; client-info<br />
# chmod 600 client-info*<br />
# cd ..</code></li>
<li>Add the following lines to your <code>sendmail.mc</code> file, filling in your ISP&#8217;s mail server:<code>define(`SMART_HOST',`your.isp.net')dnl<br />
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl<br />
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl</code></li>
<li>Generate <code>sendmail.cf</code>:<code># m4 sendmail.mc &gt; sendmail.cf</code></li>
<li>Restart the sendmail daemon, e.g., (this depends on your OS):<code># service sendmail restart</code> or <code># /etc/init.d/sendmail restart</code></li>
</ol>
<p>That should take care of the issue!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dingobytes.com/linux/dealing-with-sendmail-errors/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
