<?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>Website  Design &#124; Search Optimization &#124; Social Media &#124; Benzing Technologies &#187; Javascript / AJAX</title>
	<atom:link href="http://www.benzingtech.com/blog/javascript-ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benzingtech.com</link>
	<description>Your Technology Partner</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:24:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=9320</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SWFaddress solves Flash SEO problems</title>
		<link>http://www.benzingtech.com/swfaddress-solves-flash-seo-problems/</link>
		<comments>http://www.benzingtech.com/swfaddress-solves-flash-seo-problems/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 12:53:50 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[flash seo]]></category>
		<category><![CDATA[flash url rewrite]]></category>
		<category><![CDATA[SWFaddress]]></category>

		<guid isPermaLink="false">http://www.benzingtech.com/?p=925</guid>
		<description><![CDATA[<p>One of the biggest draw backs of flash is using back and forward buttons in the browser and Search Engine Optimization in the URL&#8217;s. Well now look no further. Introducing SWFaddress &#8211; a small JavaScript library that lets you create virtual URLs for Flash and Ajax. SWFaddress has been around&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>One of the biggest draw backs of flash is using back and forward buttons in the browser and Search Engine Optimization in the URL&#8217;s. Well now look no further. Introducing <a href="http://www.asual.com/swfaddress/" target="_blank">SWFaddress</a> &#8211; a small JavaScript library that lets you create virtual URLs for Flash and Ajax. SWFaddress has been around since 2006, and surprisingly not all Flash sites are utilizing this tool.</p>
<p>However, SWFAddress is really only as good as your implementation of it. A sloppy implementation makes it more of a liability than a benefit. So let&#8217;s show you the right way to get it working.</p>
<p>SWFAddress can be quickly added to a Website that uses SWFObject only by inserting the JavaScript files into your header section like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;swfobject/swfobject.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:0--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;swfaddress/swfaddress.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:1--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Now the internal implementation of SWFAddress is somewhat simple and straight forward. Once a Flash movie containing the library is embedded in an HTML page, it automatically initializes itself and provides the developer with notification of state changes that need to be implemented. This might not be the easiest task for everybody, but SWFAddress streamlines the process by fully supporting testing workflow inside the Flash Program and Standalone Player. URL changes can be invoked from mouse-click events, frame actions, or HTML links.</p>
<p>Here is sample code that can be added to a MovieClip button:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">this.onRelease = function () {
&nbsp;
      SWFAddress.setValue(&quot;/portfolio&quot;);
}</pre></div></div>

<p>For links in HTML-formatted TextFields, the following approach should be used:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;asfunction:SWFAddress.setValue,/portfolio/&quot;</span>&gt;</span>Go to Portfolio<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>SWFAddress has a single onChange event where the navigation logic needs to be coded. The complexity may vary depending on the Website, but if it&#8217;s planned from the beginning, it may improve maintainability by centralizing all the controller actions.</p>
<p>Here is an example of a running logic for the onChange event:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">SWFAddress.onChange = function () {
&nbsp;
      var navigation = new Object();
      navigation.home = {frame: 1, title: &quot;Welcome&quot;};
      navigation.about = {frame: 10, title: &quot;About Us&quot;};
      navigation.contact = {frame: 20, title: &quot;Contact Us&quot;};
&nbsp;
      var value = SWFAddress.getValue();
&nbsp;
      website_mc.gotoAndStop(navigation[value].frame);
&nbsp;
      SWFAddress.setTitle(navigation[value].title);
}</pre></div></div>

<p>The setTitle method allows you to add unique titles to every section of the Website and they will appear in the browser&#8217;s titlebar. It should be used inside the onChange event in order to correctly display the initial title value when the page loads.</p>
<p>With SEO in mind SWFaddress covers this flawlessly. It enables the generation of real links that expose the appropriate content to search engines. The magic happens with some interesting URL rewriting and some trivial server-side code. The following is an example how it works for a Website located at http://www.domain.com that contains a portfolio section.</p>
<p>SWFAddress uses http://www.domain.com/#/portfolio/. The URL that can get indexed is http://www.domain.com/portfolio/ and therefore it should exist as a link in the HTML code of the page. When someone visits the indexed address, the rewriting functionality makes a redirect to the URL that SWFAddress expects. Everything happens on the server side so no user interaction is required.</p>
<p>The situation is different when the same link is followed by a search engine bot (spider). In this case the address is rewritten without any redirection to http://www.domain.com/?swfaddress=/portfolio/. The page that handles all this should use a server-side technology in order to generate the appropriate content depending on the &#8220;swfaddress&#8221; parameter value.</p>
<p>Page requests containing GET parameters (?var=something) such as http://www.domain.com/#/portfolio/?desc=true&amp;year=2001 are handled similarly. The search engines will index http://www.domain.com/portfolio/?desc=true&amp;year=2001 and the script will expect http://www.domain.com/?swfaddress=/portfolio/&amp;desc=true&amp;year=2001.</p>
<p>The result is a fully indexed Flash Website with deep linking support. This works great and the result is even better. Now we can all have search engine friendly Flash sites. YAY!</p>
<p>While this approach improves the usability of Flash content over the Web, it also requires an additional effort, such as some manual work for static html websites and some smart code for dynamic ones. The best case will be a Flash Content Management System that automates the whole process.</p>
<p>SWFaddress promises to continue adding interesting functionality like AJAX support, transparent user tracking with Google Analytics, and enhanced event handling. It should definitely be considered for your next Flash project.</p>
<p><strong>Download SWFaddress:</strong> <a href="http://www.asual.com/swfaddress/" target="_blank">HERE</a><br />
<strong>View an Example Site:</strong> <a href="http://www.asual.com/swfaddress/samples/flash/" target="_blank">HERE</a></p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>flash seo</strong></li>
<li><a href="http://www.apexdesignsllc.com/2009/10/07/web-designerflashseo-web-design-jobs/">Web Designer/<strong>Flash</strong>/<strong>SEO</strong> | Web Design Jobs</a></li>
<li><a href="http://seoblackhat.com/2009/08/01/flash-and-seo/"><strong>Flash</strong> and <strong>SEO</strong></a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>flash url rewrite</strong></li>
<li><a href="http://marketingbones.com/sherlock-holmes-the-seo-inquiry-part-ii/">Sherlock Holmes &amp; the SEO Inquiry-Part II</a></li>
<li><a href="http://www.biskero.org/?p=4142"><strong>Flash</strong> 10.1 Mobile, Air Mobile and <strong>Flash</strong> Lite content?! | biskero</a></li>
<li><a href="http://www.alan.com/2009/10/06/conservative-rewrite-bible-to-take-out-liberal-parts/">Alan Colmes&#8217; Liberaland » Conservatives <strong>Rewrite</strong> Bible To Take Out <strong>&#8230;</strong></a></li>
<li><a href="http://www.freelaptopcollege.com/free-laptops-for-students/">Free Laptops For Students</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>SWFaddress</strong></li>
<li><a href="http://awebso.com/site/?p=551">XMLROYALE | AUTO <strong>SWFADDRESS</strong> XML WEBSITE TEMPLATE | أرخص هوست فى <strong>&#8230;</strong></a></li>
<li><a href="http://blog.cjgammon.com/?p=114"><strong>swfaddress</strong> 2.3 problems: ie7 not loading parameters/not updating url</a></li>
</ul>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>flash seo</b></li>
<li><a href="http://www.maine-seo.com/flyte-new-media/maine-seo-project-reliable-networks-flash-seo">Maine <b>SEO</b> Project: Reliable Networks (<b>Flash</b> &amp; <b>SEO</b>) | Maine <b>SEO</b> Blog</a></li>
<li><a href="http://7dollartemplates.com/blog/?p=6384"><b>Flash</b> is bad for <b>SEO</b> (Search Engine Optimization) | 7 Dollart <b>&#8230;</b></a></li>
<li><a href="http://trevorweir.com/Seo/seo/fair-play-to-fair-pay-in-seo-services/">Fair Play To Fair Pay in <b>SEO</b> Services | <b>SEO</b> Marketing Toronto</a></li>
<li><a href="http://seoblackhat.com/2009/08/01/flash-and-seo/"><b>Flash</b> and <b>SEO</b></a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>flash url rewrite</b></li>
<li><a href="http://marketingbones.com/sherlock-holmes-the-seo-inquiry-part-ii/">Sherlock Holmes &amp; the SEO Inquiry-Part II</a></li>
<li><a href="http://benzingtech.com/galaxy/swfaddress-solves-flash-seo-problems/">SWFaddress solves <b>Flash</b> SEO problems</a></li>
<li><a href="http://www.benzingtech.com/swfaddress-solves-flash-seo-problems/">SWFaddress solves <b>Flash</b> SEO problems</a></li>
<li><a href="http://www.freelanceonweb.com/2009/12/re-write-sales-letter-rebranding-by-webman2005/"><b>Re-write</b> Sales Letter Rebranding by Webman2005 | Freelance On Web</a></li>
<li><a href="http://fix-email-errors.com/featured/3-types-of-data-storage-media-a-guide-to-selecting-media-for-storing-backing-up-computer-data">3 Types of Data Storage Media:- A Guide to Selecting Media for <b>&#8230;</b></a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>SWFaddress</b></li>
<li><a href="http://blog.cjgammon.com/?p=114"><b>swfaddress</b> 2.3 problems: IE7 not loading parameters/not updating <b>&#8230;</b></a></li>
<li><a href="http://www.flash-square.com/news/swfaddress-2-4.html"><b>SWFAddress</b> 2.4 | Flash-Square</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/swfaddress-solves-flash-seo-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking outgoing links with Google Analytics and jQuery</title>
		<link>http://www.benzingtech.com/tracking-outgoing-links-google-analytics-jquery/</link>
		<comments>http://www.benzingtech.com/tracking-outgoing-links-google-analytics-jquery/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 18:13:28 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery plugin]]></category>

		<guid isPermaLink="false">http://www.benzingtech.com/?p=868</guid>
		<description><![CDATA[<p>When looking for an easy way to track outgoing links in Google Analytics with jQuery I came across this plugin. However, I needed a more flexible way of link tracking, with more control on which links to track and in what format.</p>
<p>For those reasons I use a small jQuery&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>When looking for an easy way to track outgoing links in Google Analytics with jQuery I came across <a rel="nofollow" href="http://plugins.jquery.com/project/gaTracker">this plugin</a>. However, I needed a more flexible way of link tracking, with more control on which links to track and in what format.</p>
<p>For those reasons I use a small jQuery plugin written by Gerry Vandermaesen. Usage is simple:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('a[rel=external]').gaLinkTrack();</pre></div></div>

<p>Of course you can modify the selector to your needs, but (for now) you can only track links.</p>
<p>Inside Google Analytics, the tracked link takes the format “/{rel}/{domain}/{page}” by default. If no rel attribute is present, it defaults to “external”. You can change the format of the tracked links by passing the path option:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('a[rel=download]').gaLinkTrack( { path: '/downloads/{page}' } );</pre></div></div>

<p>When specifying the path format you can use any of the following placeholders: {rel}, {domain}, {page}. You can specify a default value for any of the placeholders (notably {rel}) as illustrated here:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('a.download').gaLinkTrack( { path: '/{rel:download}/{page}' } );</pre></div></div>

<p>This is a first version so feedback and suggestions are more than welcome. Things still to come: proper handling of email links, more options for customizing the tracked path, and more&#8230;</p>
<p>Download the full source code (<a rel="nofollow" href="http://www.gerryvandermaesen.com/wp-content/uploads/2009/06/jquery-galinktrack-1.0.js">jquery-galinktrack-1.0.js</a>) or the minified version (<a rel="nofollow" href="http://www.gerryvandermaesen.com/wp-content/uploads/2009/06/jquery-galinktrack-1.0.min.js">jquery-galinktrack-1.0.min.js</a>).</p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery</strong></li>
<li><a href="http://www.devirtuoso.com/2009/08/jquery-image-zoom-plugin/"><strong>jQuery</strong> Image Zoom Plugin</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery plugin</strong></li>
<li><a href="http://w3updates.com/anythingslider-jquery-plugin/">AnythingSlider <strong>jQuery Plugin</strong></a></li>
<li><a href="http://tylermuth.wordpress.com/2009/08/19/japex-a-jquery-plugin-for-apex/">jApex – A <strong>jQuery Plugin</strong> for APEX « Tyler Muth&#8217;s Blog</a></li>
<li><a href="http://www.spottedhere.com/dallas/club/plush">Plush Nightclub In Dallas</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/tracking-outgoing-links-google-analytics-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery with other frameworks without conflicts</title>
		<link>http://www.benzingtech.com/jquery-frameworks-conflicts/</link>
		<comments>http://www.benzingtech.com/jquery-frameworks-conflicts/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 23:05:22 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.benzingtech.com/?p=864</guid>
		<description><![CDATA[<p>While jQuery is certainly a popular JavaScript framework, it’s by no means the only game in town. Other frameworks such as Prototype, MooTools, Dojo and many others all have their own strengths, weaknesses, and devoted groupies.</p>
<p>Generally speaking, these frameworks all play well together — you can mix and match&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>While jQuery is certainly a popular JavaScript framework, it’s by no means the only game in town. Other frameworks such as Prototype, MooTools, Dojo and many others all have their own strengths, weaknesses, and devoted groupies.</p>
<p>Generally speaking, these frameworks all play well together — you can mix and match framework functionality to your heart’s content, as long as you don’t mind the additional overhead of loading several libraries simultaneously. So you have a calendar widget in jQuery that you love, but you’re already using Prototype to animate your navigation bar? Don’t be shy… use both!</p>
<p>Of course, every once in a while you can run in to problems when combining JS frameworks — particularly (in my experience) when combining jQuery and Prototype. Luckily, jQuery was kind enough to provide us with a workaround.</p>
<p><strong>The Problem: Sharing Syntax</strong></p>
<p>The most common compatibility problem stems from both jQuery and Prototype using the same shortcut syntax: namely, the $().doSomething syntax. Here’s a sample line of code in jQuery:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('#myelement').addClass('active');</pre></div></div>

<p>And the same functionality in Prototype:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('myelement').addClassName('active');</pre></div></div>

<p>Note the basic similarity? Both frameworks claim the dollar sign notation for themselves, which can wreak havoc on snippets of code dropped willy-nilly into a website. If your jQuery code is grabbed up by Prototype, things will stop working fast. And similarly, if your Prototype code is snagged by jQuery, not even the awesome power of jQuery will be enough to overcome the code confusion.</p>
<p><strong>The Solution: noConflict Mode</strong></p>
<p>But not to worry! jQuery has provided us with a workaround called “noConflict mode.”</p>
<p>By default, there are two equally correct ways to call a jQuery function — the dollar sign notation, and “jQuery” notation:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('#myelement').show();
jQuery('#myelement').show();</pre></div></div>

<p>Both of the lines above do exactly the same thing. However, most people use and prefer the dollar sign notation. Why? Probably because it’s shorter, and if web developers didn’t care about brevity in their code, they probably wouldn’t have used a framework in the first place.</p>
<p>Of course, just using the longer jQuery notation isn’t enough. If jQuery has already claimed the dollar sign for itself, any Prototype functionality relying on that notation will still be grabbed by jQuery.</p>
<p>This is where the noConflict function comes in handy. Simply run the following line after both Prototype and jQuery have been loaded:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">jQuery.noConflict();</pre></div></div>

<p>This will cause jQuery to give up the dollar-sign notation, allowing the other library to take it over. And you can still use your jQuery snippet, provided you change all instances of $() to jQuery().<br />
Keeping it Short</p>
<p>The noConflict mode does have one other bit of functionality that I’ve found useful in some of my projects: you can select a different variable to use instead of the standard “jQuery”. The usage looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">var $j = jQuery.noConflict();</pre></div></div>

<p>Now in addition to using the default jQuery() notation, I can also use the shorter $j() notation. This allows me to avoid running into problems with other frameworks, while still enjoying almost the same conciseness in my code.</p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery</strong></li>
<li><a href="http://www.devirtuoso.com/2009/08/jquery-image-zoom-plugin/"><strong>jQuery</strong> Image Zoom Plugin</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/jquery-frameworks-conflicts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing jQuery $(document).ready()</title>
		<link>http://www.benzingtech.com/introducing-jquery-document-ready/</link>
		<comments>http://www.benzingtech.com/introducing-jquery-document-ready/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 22:10:48 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[$(document).ready()]]></category>
		<category><![CDATA[jquery introduction]]></category>

		<guid isPermaLink="false">http://www.benzingtech.com/?p=859</guid>
		<description><![CDATA[<p>This is the first thing to learn about jQuery: If you want an event to work on your page, you should call it inside the $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.</p>
<p><em>JavaScript:</em></p>
<pre style="width: 250px;"<p>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This is the first thing to learn about jQuery: If you want an event to work on your page, you should call it inside the $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.</p>
<p><em>JavaScript:</em></p>
<pre style="width: 250px;" lang="html4strict">$(document).ready(function() {
 // put all your jQuery goodness in here.
});</pre>
<p>The $(document).ready() function has a ton of advantages over other ways of getting events to work. First of all, you don&#8217;t have to put any &#8220;behavioral&#8221; markup in the HTML. You can separate all of your javascript/jQuery into a separate file where it&#8217;s easier to maintain and where it can stay out of the way of the content. I never did like seeing all those &#8220;javascript:void()&#8221; messages in the status bar when I would hover over a link. That&#8217;s what happens when you attach the event directly inside an &lt;a href&gt; tag.</p>
<p>On some pages that use traditional javascript, you&#8217;ll see an &#8220;onload&#8221; attribute in the &lt;body&gt; tag. The problem with this is that it&#8217;s limited to only one function. Oh yeah, and it adds &#8220;behavioral&#8221; markup to the content again. Jeremy Keith&#8217;s excellent book, DOM Scripting, showed me how to create an addLoadEvent function to a separate javascript file that allows for multiple functions to be loaded inside it. But it requires a fair amount of code for something that should be rather straightforward. Also, it triggers those events when the window loads, which leads me to another advantage of $(document).ready().</p>
<p>With $(document).ready(), you can get your events to load or fire or whatever you want them to do before the window loads. Everything that you stick inside its brackets is ready to go at the earliest possible moment — as soon as the DOM is registered by the browser, which allows for some nice hiding and showing effects and other stuff immediately when the user first sees the page elements.</p>
<p>It might help the absolute beginners to see an example of the &lt;head&gt; where you would include your scripts. Note that CSS stylesheets come before the jQuery file, and the jQuery file comes before your custom script:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #ddbb00;">&amp;lt;</span> !DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
  &quot;http://www.w3.org/TR/html4/strict.dtd&quot;<span style="color: #ddbb00;">&amp;gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:0--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;yourcustomscript.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:1--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- the body of your document goes here --&gt;</span></pre></div></div>

<p>It is in &#8220;yourcustomscript.js&#8221; that you would place your script inside the $(document).ready() block.</p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>$(document).ready()</strong></li>
<li><a href="http://www.frenzyblogging.com/2009/09/04/document-locator-ready-for-windows-7-windows-server-2008-r2/"><strong>Document</strong> Locator <strong>Ready</strong> for Windows 7, Windows Server 2008 R2 <strong>&#8230;</strong></a></li>
<li><a href="http://w3updates.com/color-changing-text-and-backgrounds-with-jquery/">Color Changing Text and Backgrounds with jQuery</a></li>
<li><a href="http://w3updates.com/create-a-vertical-horizontal-and-diagonal-sliding-content-website-with-jquery/">Create a Vertical, Horizontal and Diagonal Sliding Content Website <strong>&#8230;</strong></a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery introduction</strong></li>
<li><a href="http://w3updates.com/create-a-vertical-horizontal-and-diagonal-sliding-content-website-with-jquery/">Create a Vertical, Horizontal and Diagonal Sliding Content Website <strong>&#8230;</strong></a></li>
<li><a href="http://blog.netvisionwebdesign.com/website-goodies/jquery-introduction-the-new-javascript-7-part-series-on-the-7-most-important-tools-for-your-website/"><strong>jQuery</strong> &#8211; The new JavaScript: 7 Part series on the 7 most important <strong>&#8230;</strong></a></li>
<li><a href="http://blog.netvisionwebdesign.com/37/jquery-introduction-the-new-javascript-7-part-series-on-the-7-most-important-tools-for-your-website/"><strong>jQuery Introduction</strong> – The new JavaScript: 7 Part series on the 7 <strong>&#8230;</strong></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/introducing-jquery-document-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a jQuery draggable sitemap</title>
		<link>http://www.benzingtech.com/create-jquery-draggable-sitemap/</link>
		<comments>http://www.benzingtech.com/create-jquery-draggable-sitemap/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 14:49:52 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[draggable jquery sitemap]]></category>
		<category><![CDATA[jquery sitemap]]></category>

		<guid isPermaLink="false">http://www.benzingtech.com/?p=848</guid>
		<description><![CDATA[<p>There are a handful of javascript libraries and plugins available that attempt this task, but none of them worked flawlessly with our HTML. The real issue here is that javascript alone cannot produce a slick solution, the HTML and CSS need to be carefully constructed to ensure that the experience&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>There are a handful of javascript libraries and plugins available that attempt this task, but none of them worked flawlessly with our HTML. The real issue here is that javascript alone cannot produce a slick solution, the HTML and CSS need to be carefully constructed to ensure that the experience is seamless and pleasant.<br />
The HTML.</p>
<p>Our HTML consists of nested unordered lists, with each list item containing a definition list for the title, page type, publish status, and action links for editing or deleting the page. The feature for expanding and collapsing child pages already existed, making things extra fun.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sitemap&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dl</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dt</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>expand/collapse<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Page Title<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dt</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>Text Page<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>Published<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>delete<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dl</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--child pages--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p><strong>The requirements.</strong></p>
<p>The behaviour had to intuitive for the user, they need to be able to reorder pages and move entire sections to new parents. It had to be clear to the user where a page would end up when they dropped it (ie. between pages or as a child page).<br />
Simplifying the task.</p>
<p>When one page is dropped over another page, there are three possible outcomes. The page can end up before, after or as a child. This gets particularly tricky at the boundary point between the last child of a sub list and the following sibling. If the resulting location of where a page ends up is the difference of a couple of pixels, the user could become frustrated. We decided to simplfy the problem so that a page could be dropped only before items or as children of items. The only limitation here is that you couldn’t easily drop an item as the last child of a list, but this is only a minor issue as moving the last child up would achieve the same result. You can also drop an item on the parent to cause it to become the last child, but this isn’t so obvious really.</p>
<p>This means for each item on our list we now need to identify two areas where the user can drop the page, on the page to be a child, and above the page to be a sibling.<br />
The javascript.</p>
<p>The great thing about jQuery / jQuery UI is how it lets me write the code I want to write, and takes care of cross-browser behaviours and gaps in DOM manipulation. Anyone who has attempted at creating drag and drop functionality for a website will be well aware of the headaches involved in getting everything to work smoothly across browsers. jQuery UI seems to handle this brilliantly.</p>
<p>The first thing I want to do is create a div inside the list item to act as a dropzone for placing items as siblings.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('#sitemap li').prepend('
&nbsp;
');</pre></div></div>

<p><em>piece of cake.</em></p>
<p>To allow an item to be dragged, we simply call the draggable() function on the items that can be dragged.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('#sitemap li').draggable({
    handle: ' <span style="color: #ddbb00;">&amp;gt;</span> dl',
    opacity: .8,
    addClasses: false,
    helper: 'clone',
    zIndex: 100
});</pre></div></div>

<p>As we are dealing with nested lists, it is important that only the definition list inside our list item acts as a handle, otherwise our old friend Internet Explorer can get a little confused over who’s meant to be moving and who should be staying where they are. By specifying ‘clone’ we create a duplicate list item that follows the mouse, while the original item waits patiently for us to decide where it should belong. An opacity of 0.8 and a high zIndex keeps the clone on top of everyone else and slightly opaque. It’s the little touches that really count.</p>
<p><strong>The magic.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('#sitemap dl, #sitemap .dropzone').droppable({
    accept: '#sitemap li',
    tolerance: 'pointer',
    drop: function(e, ui) {
        var li = $(this).parent();
        var child = !$(this).hasClass('dropzone');
        //If this is our first child, we'll need a ul to drop into.
        if (child <span style="color: #ddbb00;">&amp;amp;&amp;amp;</span> li.children('ul').length == 0) {
            li.append('
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>');
        }
        //ui.draggable is our reference to the item that's been dragged.
        if (child) {
            li.children('ul').append(ui.draggable);
        }
        else {
            li.before(ui.draggable);
        }
        //reset our background colours.
        li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
    },
    over: function() {
        $(this).filter('dl').css({ backgroundColor: '#ccc' });
        $(this).filter('.dropzone').css({ borderColor: '#aaa' });
    },
    out: function() {
        $(this).filter('dl').css({ backgroundColor: '' });
        $(this).filter('.dropzone').css({ borderColor: '' });
    }
});<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>Ok. That’s a fair chunk of code, let’s break it down.<br />
We only want to accept sitemap list items, we don’t care about other items they care to drop here.</p>
<p>The tolerance specifys the drop item to be the element under mouse pointer, we’re expecting the user to place their mouse where the item should end up.</p>
<p>When the drop happens, this is how we decide what to do:<br />
We set the variable ‘li’ to be the parent of the dropzone (as both the definition list and the dropzone div are children of the list item). This is just for convenience.</p>
<p>When the user drops the page, we need to decide what they landed on, if it has a class ‘dropzone’ then we are placing the dropped item before us. Otherwise we are placing this as a child.</p>
<p>As the item is being dragged around, it is imperitive to give an indication as to where it will end up. We can do this by conditionally applying a background colour to whichever item we are hovering over. For the ‘dropzone’, we instead apply a border colour, as we want it to display as a solid line between the two items.</p>
<p>At this point we can also fire off our update in an ajax post to the server, in order to commit the change.</p>
<p><strong>The CSS.</strong></p>
<p>The secret to the interface working really well is CSS. By making sure we have the right paddings and heights in the right places we give the user enough space to comfortably drop items. If we keep the space around the definition list tight, and apply a 4px border plus 6px height to the ‘dropzone’ div, we give the user 10 pixels of droppable area. This is plenty to guarantee the user will be comfortable. The 4px border gives us a strong, clear indication that the item will be dropped as a sibling.</p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>draggable jquery sitemap</strong></li>
<li><a href="http://www.davemcdermid.co.uk/2009/08/sortable-sitemap/">Dave McDermid » Blog Archive » Building a sortable <strong>sitemap</strong> with <strong>&#8230;</strong></a></li>
<li><a href="http://azoffdesign.com/plugins/js/overscroll">Azoff Design » Blog Archive » An iPhone Scrolling Plugin for <strong>jQuery</strong></a></li>
<li><a href="http://www.freelaptopcollege.com">College Laptops</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery sitemap</strong></li>
<li><a href="http://www.davemcdermid.co.uk/2009/08/sortable-sitemap/">Dave McDermid » Blog Archive » Building a sortable <strong>sitemap</strong> with <strong>&#8230;</strong></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/create-jquery-draggable-sitemap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a jQuery RSS Aggregator (reader)</title>
		<link>http://www.benzingtech.com/creating-a-jquery-rss-aggregator-reader/</link>
		<comments>http://www.benzingtech.com/creating-a-jquery-rss-aggregator-reader/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 22:26:14 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery rss aggregator]]></category>
		<category><![CDATA[jquery rss reader]]></category>

		<guid isPermaLink="false">http://benzingtech.com/?p=838</guid>
		<description><![CDATA[<p>Chad Udell with Visual Rinse wrote a fantastic tutorial on creating a jQuery RSS Feed Reader using a PHP proxy to bypass browser security displaying any xml feed using AJAX.</p>
<p>Read more on his blog post http://visualrinse.com/2008/09/24/how-to-build-a-simple-rss-reader-with-jquery/</p>
<h4>Related Blogs</h4>

Related Blogs on <strong>jquery</strong>
<strong>jQuery</strong> Image Zoom Plugin
Movie Posters


Related<p>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Chad Udell with Visual Rinse wrote a fantastic tutorial on creating a jQuery RSS Feed Reader using a PHP proxy to bypass browser security displaying any xml feed using AJAX.</p>
<p>Read more on his blog post <a href="http://visualrinse.com/2008/09/24/how-to-build-a-simple-rss-reader-with-jquery/">http://visualrinse.com/2008/09/24/how-to-build-a-simple-rss-reader-with-jquery/</a></p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery</strong></li>
<li><a href="http://www.devirtuoso.com/2009/08/jquery-image-zoom-plugin/"><strong>jQuery</strong> Image Zoom Plugin</a></li>
<li><a href="http://www.theoriginalunoriginal.com">Movie Posters</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery rss aggregator</strong></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery rss reader</strong></li>
<li><a href="http://www.whatsthepointofsharing.com/?p=284">Creating an <strong>RSS reader</strong> using a Federated Search Web Part | Whats <strong>&#8230;</strong></a></li>
<li><a href="http://www.lateralcode.com/learning-jquery-review/">Learning <strong>jQuery</strong> 1.3 Review</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/creating-a-jquery-rss-aggregator-reader/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery Anything Slider Plugin</title>
		<link>http://www.benzingtech.com/jquery-anything-slider-plugin/</link>
		<comments>http://www.benzingtech.com/jquery-anything-slider-plugin/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:17:06 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[jquery plugin]]></category>
		<category><![CDATA[jquery slider]]></category>

		<guid isPermaLink="false">http://benzingtech.com/?p=825</guid>
		<description><![CDATA[<p>Originally Posted at CSS-Tricks</p>
<p>Just what the world needs, another jQuery slider. YAWN. I know, check this one out though, it’s got lots of cool features.</p>
<p>Here on CSS-Tricks, I’ve created a number of different sliders. Three, in fact. A “featured content” slider, a “start/stop slider“, and “moving boxes“. Each&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Originally Posted at <a href="http://css-tricks.com/anythingslider-jquery-plugin/" target="_blank">CSS-Tricks</a></p>
<p>Just what the world needs, another jQuery slider. YAWN. I know, check this one out though, it’s got lots of cool features.</p>
<p>Here on CSS-Tricks, I’ve created a number of different sliders. Three, in fact. A “featured content” slider, a “start/stop slider“, and “moving boxes“. Each of them had some cool interesting feature that I needed to build at the time. All were well-received, but as is the case with these things, people want them to do X, Y, and Z in addition to what they already did.</p>
<p>This new AnythingSlider is an attempt at bringing together the functionality of all of those previous sliders and adding new features. In other words, to create a really “full featured” slider that could be widely useful. This is the first time (on CSS-Tricks) that one of these sliders is an actual plugin as well, which should make implementing it and customizing it much easier.</p>
<p><img class="alignnone size-full wp-image-826" title="anythingslider-example" src="http://benzingtech.com/wp-content/uploads/2009/08/anythingslider-example.jpg" alt="anythingslider-example" width="570" height="281" /></p>
<p>[<a href="http://css-tricks.com/examples/AnythingSlider/" target="_blank">VIEW DEMO</a>]      [<a href="http://css-tricks.com/examples/AnythingSlider.zip" target="_blank">DOWNLOAD</a>]</p>
<h3>Features</h3>
<ul>
<li> Slides are HTML Content (can be anything)</li>
<li> Next Slide / Previous Slide Arrows</li>
<li> Navigation tabs are built and added dynamically (any number of slides)</li>
<li> Optional custom function for formatting navigation text</li>
<li> Auto-playing (optional feature, can start playing or stopped)</li>
<li> Each slide has a hashtag (can link directly to specific slides)</li>
<li> Infinite/Continuous sliding (always slides in the direction you are going, even at “last” slide)</li>
<li> Multiple sliders allowable per-page (hashtags only work on first)</li>
<li> Pauses autoPlay on hover (option)</li>
<li>Link to specific slides from static text links</li>
</ul>
<h3>Usage &amp; Options (defaults)</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$('.anythingSlider').anythingSlider({
        easing: &quot;swing&quot;,                // Anything other than &quot;linear&quot; or &quot;swing&quot; requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        startText: &quot;Start&quot;,             // Start text
        stopText: &quot;Stop&quot;,               // Stop text
        navigationFormatter: null       // Details at the top of the file on this use (advanced use)
});</pre></div></div>

<h3>Customization</h3>
<p><strong>Adding/Removing Slides</strong><br />
Just add or remove more <code> </code></p>
<li></li>
<p>items from the list inside <code> </code></p>
<p>, everything else happens automatically.</p>
<p><strong>Adjusting Size</strong><br />
For example, if you wanted to make the slides 580px wide instead of 680px wide, you just need to change some CSS. Change the width of .anythingSlider ul li to 580px, change the width of .anythingSlider .wrapper to 580px, and reduce the width of .anythingSlider 100px to 660px.</p>
<p><strong>Linking Directly To Slides from Static Links</strong><br />
Target the link using and ID or Class (or whatever), and apply a click handler. Then call the plugin function and pass it a number of the slide you are trying to link to:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">$(&quot;#slide-jump&quot;).click(function(e){
    $('.anythingSlider').anythingSlider(6);
    e.preventDefault();
});</pre></div></div>

<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery plugin</strong></li>
<li><a href="http://w3updates.com/anythingslider-jquery-plugin/">AnythingSlider <strong>jQuery Plugin</strong></a></li>
<li><a href="http://tylermuth.wordpress.com/2009/08/19/japex-a-jquery-plugin-for-apex/">jApex – A <strong>jQuery Plugin</strong> for APEX « Tyler Muth&#8217;s Blog</a></li>
<li><a href="http://www.spottedhere.com/dallas/club/encore+ultra+lounge">Club Encore Dallas</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery slider</strong></li>
<li><a href="http://w3updates.com/anythingslider-jquery-plugin/">AnythingSlider <strong>jQuery</strong> Plugin</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/jquery-anything-slider-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Media : A Fun Tutorial on Sounds, Video, &amp; Roll Overs</title>
		<link>http://www.benzingtech.com/jquery-media-a-fun-tutorial-on-sounds-video-roll-overs/</link>
		<comments>http://www.benzingtech.com/jquery-media-a-fun-tutorial-on-sounds-video-roll-overs/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 15:45:58 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[jquery media reader]]></category>
		<category><![CDATA[jquery play sounds]]></category>
		<category><![CDATA[jquery sounds]]></category>
		<category><![CDATA[jquerysound.js]]></category>

		<guid isPermaLink="false">http://benzingtech.com/?p=557</guid>
		<description><![CDATA[<p>This article was written out of joy in finding out that jQuery has the capabilities to play sounds and music on your website. Hurray! I love the possibilities of javascript and xml and embrace it as much as I can without making the website too overwhelming with AJAX or non-search&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This article was written out of joy in finding out that jQuery has the capabilities to play sounds and music on your website. Hurray! I love the possibilities of javascript and xml and embrace it as much as I can without making the website too overwhelming with AJAX or non-search friendly.</p>
<p>We want to start by making sure you have the required libraries. Starting with the latest <a href="http://docs.jquery.com/Downloading_jQuery" target="_blank">jQuery</a>. You will also need the <a href="http://malsup.com/jquery/media/#download" target="_blank">Media</a> plugin. For the sounds example towards the bottom you will need the <a href="http://dev.jquery.com/browser/trunk/plugins/sound/jquery.sound.js?rev=4416" target="_blank">Sound</a> plugin.</p>
<h3>Playing Media Files</h3>
<p>Let&#8217;s start with a basic html page which will house our media player.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">         <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">         This is where we link to our media file it supports:</span>
<span style="color: #808080; font-style: italic;">          Quicktime aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3pg</span>
<span style="color: #808080; font-style: italic;">          Flash	flv, mp3, swf</span>
<span style="color: #808080; font-style: italic;">          Windows Media Player 	asx, asf, avi, wma, wmv</span>
<span style="color: #808080; font-style: italic;">          Real Player	ra, ram, rm, rpm, rv, smi, smil</span>
<span style="color: #808080; font-style: italic;">          Silverlight	xaml</span>
<span style="color: #808080; font-style: italic;">          iframe	html, pdf</span>
<span style="color: #808080; font-style: italic;">         --&gt;</span>
&nbsp;
This is my example jquery music player.
&nbsp;
         <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;media&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/sound.wav&quot;</span>&gt;</span>media file<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></td></tr></table></div>

<p>With our html page built out we add our jQuery scripts between our header tags:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:0--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.metadata.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:1--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.media.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:2--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:3--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>With this setup your media file link will be converted into a media player where visitors can now listen or view your media file. keep in mind if you use mp3 or flash video you will need a media player. You can <a href="http://www.longtailvideo.com/players/jw-flv-player/" target="_blank">download it here</a>.</p>
<p><a href="http://benzingtech.com/demos/jquerymedia/" target="_blank">VIEW THE DEMO</a></p>
<p>Let&#8217;s get into more advanced options. Now these options can be provided using an options object or by using the jQuery Metadata Plugin which can be downloaded in the beginning of this tutorial.</p>
<p>The following options are provided by the media player plugin by default:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">// global defautls; override as needed
$.fn.media.defaults = {
    preferMeta:    1,         // true if markup metadata takes precedence over options object
    autoplay:      0,         // normalized cross-player setting
    bgColor:       '#ffffff', // background color
    params:        {},        // added to object element as param elements; added to embed element as attrs
    attrs:         {},        // added to object and embed elements as attrs
    flashvars:     {},        // added to flash content as flashvars param/attr
    flashVersion:  '7',       // required flash version
&nbsp;
    // default flash video and mp3 player
    // @see: http://jeroenwijering.com/?item=Flash_Media_Player
    flvPlayer:     'mediaplayer.swf',
    mp3Player:     'mediaplayer.swf',
&nbsp;
    // Silverlight options
    // @see http://msdn2.microsoft.com/en-us/library/bb412401.aspx
    silverlight: {
        inplaceInstallPrompt: 'true', // display in-place install prompt?
        isWindowless:         'true', // windowless mode (false for wrapping markup)
        framerate:            '24',   // maximum framerate
        version:              '0.9',  // Silverlight version
        onError:              null,   // onError callback
        onLoad:               null,   // onLoad callback
        initParams:           null,   // object init params
        userContext:          null    // callback arg passed to the load callback
    }
};</pre></td></tr></table></div>

<p>Any global settings can be explicitly overridden by simply changing its value. For example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">// change default flash player
$.fn.media.defaults.flvPlayer = 'myCoolPlayer.swf';</pre></td></tr></table></div>

<p>So let&#8217;s use a couple of these options to get some different results. Going back to our header tag scripts we change the options to display a video.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:4--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.metadata.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:5--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.media.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:6--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:7--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>Now that you understand how to use this media plugin there are tons of available options and dynamic capabilities to really make this a marvelous contribution to the jQuery library.</p>
<h3>Roll Over Sounds</h3>
<p>Perhaps you would like to perform roll over sounds or onclick sounds using jQuery. This can be done pretty easily using the Sounds plugin which you can download in the beginning of this tutorial. Let&#8217;s start with a full source example page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:8--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.sound.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:9--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:10--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
This is my example jquery sounds on rollover.
&nbsp;
         <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;rollover&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>mouse over sound<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></td></tr></table></div>

<p>You should have a great understanding how these plugins can help enhance your website to play your media content or cool rollover sounds. If you have any questions or still need help feel free to comment.<br />
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>jquery media reader</b></li>
<li><a href="http://www.benzingtech.com/creating-a-jquery-rss-aggregator-reader/">Creating a <b>jQuery</b> RSS Aggregator (<b>reader</b>) « Benzing Technologies <b>&#8230;</b></a></li>
<li><a href="http://creativityflows.com/blog/?p=7431">Twitter Weekly Updates for 2009-12-27 « Creativity Flows</a></li>
<li><a href="http://dev.tonic1394.com/2009/08/summer-2009-linkpost-extravaganza/">Summer 2009 LinkPost Extravaganza! | E-com DevBlog</a></li>
<li><a href="http://www.spiritualmediablog.com/2009/10/29/busting-loose-from-the-business-game-review/">Spiritual <b>Media</b> Blog » Blog Archive » Busting Loose from the <b>&#8230;</b></a></li>
<li><a href="http://designrfix.com/freebies/freebies-social-media-icons-blog">Freebies: Social <b>Media</b> Icons for Your Blog | designrfix.com</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>jquery play sounds</b></li>
<li><a href="http://www.nineteenfortyone.com/2009/12/build-a-better-dialog-box-with-jquery/">Build A Better Dialog Box With <b>jQuery</b> « Zoom Creates Blogs</a></li>
<li><a href="http://grasshopperpebbles.com/ajax/jquery-plugin-imbookflip-page-turning-without-flash/"><b>JQuery</b> Plugin: imBookFlip. Page Turning without Flash <b>&#8230;</b></a></li>
<li><a href="http://www.nczonline.net/blog/2009/12/22/protect-ie-from-empty-img-src/">Protect IE from empty img src | NCZOnline</a></li>
<li><a href="http://www.webdevplayground.com/2009/09/a-basic-memory-game-with-jquery-and-php/">Creating a basic memory game with <b>jQuery</b> and php | Webdev Playground</a></li>
<li><a href="http://www.technoreaders.com/2009/05/11/jplayer-jquery-mp3-player-plugin/">jPlayer: <b>jQuery</b> Mp3 Player Plugin | TechnoReaders.com</a></li>
<li><a href="http://dev.tonic1394.com/2009/06/linkpost-may-2009/">LinkPost for May 2009 | E-com DevBlog</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>jquery sounds</b></li>
<li><a href="http://bjarlestam.wordpress.com/2009/11/30/performance-of-jquery-live-events/">Performance of <b>jQuery</b> Live events « bjarlestam</a></li>
<li><a href="http://www.nineteenfortyone.com/2009/12/build-a-better-dialog-box-with-jquery/">Build A Better Dialog Box With <b>jQuery</b> « Zoom Creates Blogs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/jquery-media-a-fun-tutorial-on-sounds-video-roll-overs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced jQuery Form with Validation</title>
		<link>http://www.benzingtech.com/advanced-jquery-form-with-validation/</link>
		<comments>http://www.benzingtech.com/advanced-jquery-form-with-validation/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 02:20:31 +0000</pubDate>
		<dc:creator>Rusty</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[ajax forms]]></category>
		<category><![CDATA[jquery form]]></category>

		<guid isPermaLink="false">http://benzingtech.com/?p=530</guid>
		<description><![CDATA[<p>With technologies such as AJAX (Asynchronous Javascript And XML) the web is getting many new ways to enhance the user experience. And one way to do this is a simple contact form. Being able to have people contact you online without getting them lost in your website.</p>
<p>This is where&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>With technologies such as AJAX (Asynchronous Javascript And XML) the web is getting many new ways to enhance the user experience. And one way to do this is a simple contact form. Being able to have people contact you online without getting them lost in your website.</p>
<p>This is where AJAX steps in and is our savor. Lets start with compiling what we need. First make sure you have the latest <a href="http://docs.jquery.com/Downloading_jQuery" target="_blank">jQuery</a> edition. Then you will also need <a href="http://plugins.jquery.com/project/form" target="_blank">jQuery Form</a> to help with the validation and submission of the form. Now that we have our libraries. Let&#8217;s start coding!</p>
<p><strong>1.</strong> Add a form to your page. Just a normal form, no special markup required:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myForm&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sendmail.php&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span>&gt;</span>
    Name:
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    E-Mail:
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    Comment: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;comment&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Submit Comment&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

<p><strong>2.</strong> Include the jQuery and Form Plugin files and a short script to initialize the form when the DOM is ready:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:0--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.form.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:1--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:2--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p><strong>That&#8217;s It!</strong> Now let&#8217;s customize and make this more advanced.</p>
<p>We start with our jQuery code on our submission page. I will try to explain the code in detail at each line to help you understand the process.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:3--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/jquery.form.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:4--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--mce:5--&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Now lets write out the <strong>sendmail.php</strong> file:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">// Check that there is content being submitted to this file.
if(!empty($_POST['name']) <span style="color: #ddbb00;">&amp;amp;&amp;amp;</span> !empty($_POST['email'])) {
&nbsp;
// Put submitted values into variables to use in the build out of the email.
$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['comment'];
&nbsp;
$to = &quot;receiver@email.com&quot;;  // Who the email goes to
$subject = &quot;Your Email Subject&quot;; // Your mail subject
&nbsp;
// Build the headers to help avoid going to spam folder
$headers = &quot;From: sender@email.com\r\n&quot;;
$headers .= &quot;Reply-To: &quot;.$email.&quot;\r\n&quot;;
$headers .= &quot;Return-Path: sender@email.com\r\n&quot;;
&nbsp;
$html = &quot;Name: &quot;.$name.&quot;\r\n&quot;; // Add name
$html .= &quot;Email: &quot;.$email.&quot;\r\n&quot;; // Add email
$html .= &quot;Comment: &quot;.$comment.&quot;\r\n\r\n&quot;;  // Add form comments
$html .= &quot;IP Address: &quot;.$_SERVER['REMOTE_ADDR'].&quot;\r\n&quot;;  // Add IP Address
$html .= &quot;Date: &quot;.date('m/d/y g:i:s a').&quot;\r\n&quot;;  // Add Date this was created
&nbsp;
// Send mail and check to see if it was successful or not
 if(mail($to,$subject,$html,$headers)) {
   // The mail was sent successfully
   die(&quot;success&quot;); // This is the value returned
 } else {
   // The mail failed to send due to either your server settings or incorrect headers or email address.
   die(&quot;fail&quot;); // This is the value returned
 }
&nbsp;
} else {
   // No values were submitted... exit
   die(&quot;exit&quot;); // This is the value returned
}</pre></div></div>

<p><strong>We&#8217;re Done!</strong> This is a bit more advanced tactic for using jQuery Form and has a very easy user interface experience with a message fading in and out with a success or failure. I hope this helps you create jQuery Forms easier and more efficient.</p>
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>ajax forms</strong></li>
<li><a href="http://ivannovak.com/fta-p/ajax-contact-form/"><strong>Ajax</strong> Contact <strong>Form</strong> | Ivan Novak</a></li>
<li><a href="http://www.itmdesign.co.uk/blog/2009/04/ajax-sticky-form-and-php-sessions/"><strong>AJAX</strong> Sticky <strong>Form</strong> and PHP Sessions | Web Design and Development Blog</a></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <strong>jquery form</strong></li>
<li><a href="http://blog.creativityden.com/25-portfolio-sites-using-jquery-amazingly-well/">25 Portfolio Sites Using <strong>jQuery</strong> Amazingly Well « CreativityDen</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzingtech.com/advanced-jquery-form-with-validation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk
Object Caching 1011/1035 objects using disk

Served from: www.benzingtech.com @ 2010-07-30 19:08:49 -->