<?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>MisterSender</title>
	<atom:link href="http://www.triadwebcrafters.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.triadwebcrafters.com/blog</link>
	<description>documenting my many struggles as a programmer</description>
	<lastBuildDate>Mon, 19 Sep 2011 02:16:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>CF Free Chat</title>
		<link>http://www.triadwebcrafters.com/blog/?p=162</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=162#comments</comments>
		<pubDate>Mon, 25 Jul 2011 20:41:03 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=162</guid>
		<description><![CDATA[After my friend at kisdigital wrote a simple chat app using jQuery and Coldfusion, I decided to extend the functionality for a recent project I had been working on. The result was a surprisingly stable chat application with the ability to PM, warn, and kick out users, plus a simple settings file to control these [...]]]></description>
			<content:encoded><![CDATA[<p>After my friend at <a href="http://kisdigital.wordpress.com/2010/03/26/simple-chat-app-using-jquery-and-coldfusion/">kisdigital wrote a simple chat app using jQuery and Coldfusion</a>, I decided to extend the functionality for a recent project I had been working on.  The result was a surprisingly stable chat application with the ability to PM, warn, and kick out users, plus a simple settings file to control these additional functionalities.  I&#8217;ve set up a demo and download of <a href="http://www.triadwebcrafters.com/cfFreeChat/chat.cfm">Cf Free Chat here</a>, so feel free to use as you&#8217;d like.</p>
<p>The chat application is coldfusion &#038; jquery only, and should be highly customizable by simply changing the css. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=162</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Email Fixed!</title>
		<link>http://www.triadwebcrafters.com/blog/?p=159</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=159#comments</comments>
		<pubDate>Mon, 25 Jul 2011 18:00:57 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=159</guid>
		<description><![CDATA[I finally got the email function working on this blog. That should mean that I get notified when I get comments, instead of waiting 3 weeks to respond to people. Exciting!]]></description>
			<content:encoded><![CDATA[<p>I finally got the email function working on this blog.  That should mean that I get notified when I get comments, instead of waiting 3 weeks to respond to people. Exciting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=159</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NETWORK_ERR: XmlHttpRequest Exception 101 on Adroid Phones</title>
		<link>http://www.triadwebcrafters.com/blog/?p=155</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=155#comments</comments>
		<pubDate>Fri, 01 Jul 2011 17:43:52 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=155</guid>
		<description><![CDATA[So this little fella was the bane of my existance the past few days, and since my google-fu failed to yield the answer I was looking for, I figured I would post it so others would have better luck. The scenario: On the mobile version of a website I was working on, there was a [...]]]></description>
			<content:encoded><![CDATA[<p>So this little fella was the bane of my existance the past few days, and since my google-fu failed to yield the answer I was looking for, I figured I would post it so others would have better luck.</p>
<p>The scenario:<br />
On the mobile version of a website I was working on, there was a form that was not submitting on some android phones.  When the form was submitted, there was an AJAX call fired off to encrypt some data and inject the encrypted data into the form (this was for some PCI compliance rules).  The AJAX call worked flawlessly in any browser (regular web or phone version) except some android phones, and we were not able to pinpoint what the difference was between phones that worked and those that did not.  The AJAX call appeared to not be returning the expected data, and was instead returning the error &#8220;NETWORK_ERR: XmlHttpRequest Exception 101&#8243;.  We had originally set the AJAX call to be a synchronous post.  As soon as we changed the post to be asynchronous, the request went through without issue.  Problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=155</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Web Programming</title>
		<link>http://www.triadwebcrafters.com/blog/?p=149</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=149#comments</comments>
		<pubDate>Tue, 08 Mar 2011 21:38:30 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Website Basics]]></category>
		<category><![CDATA[101]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[jEdit]]></category>
		<category><![CDATA[mySql]]></category>
		<category><![CDATA[navicat]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=149</guid>
		<description><![CDATA[I was recently asked where to start if you were to want to learn web programming. Honestly, all you REALLY need is notepad and some great google-fu, but that&#8217;s the long difficult way of doing things, and programmers are all about making their lives easier, so here is my setup (well&#8230; mostly). For HTML/CSS If [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked where to start if you were to want to learn web programming.  Honestly, all you REALLY need is notepad and some great google-fu, but that&#8217;s the long difficult way of doing things, and programmers are all about making their lives easier, so here is my setup (well&#8230; mostly).</p>
<h3>For HTML/CSS</h3>
<p>If you can get your hands on Dreamweaver, I find it to be very helpful because it auto-completes tags.  If not, there are plenty of free options that are excellent.  <a href="http://www.jEdit.org">jEdit</a> is a good free option.</p>
<p>If you don&#8217;t have it already, download <a href="http://www.firefox.org">firefox</a>.  After installing firefox, install the <a href="http://getfirebug.com/">Firebug</a> plugin for Firefox.  This will be your new bff.</p>
<h3>For Coldfusion</h3>
<p>I use cf for server-side scripting.  It&#8217;s uber-expensive to buy, but luckily, you don&#8217;t have to buy it to develop with it and learn it.  Plus, there are plenty of options for hosting that are reasonable with cf.  Download and install <a href="http://www.adobe.com/support/coldfusion/downloads.html">Coldfusion 9 Developer&#8217;s Edition (Free)</a>.  Adobe has made it tricky to find on the page&#8230; just scroll down about halfway to the Coldfusion Product Downloads section, and DL the developer&#8217;s edition.</p>
<p>Once you&#8217;ve downloaded coldfusion, you will have to install it.  Do NOT click straight through the installation and select the suggested defaults, at least not for a couple of items.  As you click through the install options, it will ask you what server you want to install CF on (i think the default is IIS).  Unless you have a server running locally (and odds are very good you do not if you need this tutorial), you will want to select the &#8220;Enable Built-In Web Server&#8221; option.  You will also encounter a window asking you about enabling RDS.  The answer is &#8220;YES&#8221; you DO want to enable RDS.  You should be able to keep the default options for everything else.</p>
<p>Once you&#8217;ve installed coldfusion, you will need to log in to the administrator and do a couple of things.  I believe cf pulls up the administrator by default once install finishes, but if it doesn&#8217;t, just click on start&gt; adobe&gt; coldfusion&gt; administrator and open it.  you can log in with the password you set in your installation</p>
<p>After you log in, look on the sidebar for the Debugging/Logging link.  You&#8217;re going to want to enable robust exception information.</p>
<h3>Database</h3>
<p>Download <a href="http://dev.mysql.com/downloads/mysql/">mySql</a>, unzip the file, find the installer, and install it.</p>
<p>Now, download <a href="http://download.cnet.com/Navicat-Lite-Free-Multiple-Database-GUI/3000-10254_4-10870715.html">Navicat Lite (Free)</a>.  Once it&#8217;s installed, open it on up and we will connect to mySql. Click on file&gt; connection&gt; new connection. use the following settings:</p>
<p>Connection name : localhost</p>
<p>Host : localhost</p>
<p>Username : root</p>
<p>Password : (empty) (may be &#8220;root&#8221;)</p>
<p>Port : 3306 (default)</p>
<p>now, with luck, if all goes according to plan, you should now see a connection called &#8220;localhost&#8221; in navicat.  if you do, then give yourself a hug.  you should <a href="www.richardsimmons.com">hug yourself every day</a> anyway.</p>
<h3>Putting it together</h3>
<p>ok, it is not going to be possible to put EVERYTHING together, but we can at least get a web page to display with our ridiculous amount of downloading that just happened.</p>
<ol>
<li>Fire up jEdit</li>
<li>you will need to navigate to the following folder in jEdit&#8230; (in fact, you probably should just add a bookmark on your desktop here, because you will be here a LOT.)  C&gt; coldfusion9&gt; wwwroot</li>
<li>create a new folder in here&#8230; let&#8217;s call it &#8220;mySite&#8221;</li>
<li>ok, inside of your new &#8220;mySite&#8221; folder, create a new file, called &#8220;index.cfm&#8221;</li>
<li>open up your new file.  clear everything out of it and just type in &#8220;hello world!&#8221;</li>
<li>Save it.</li>
<li>Ok, now you will need to open up firefox.</li>
<li>go here: http://localhost:8500/mySite/index.cfm</li>
<li> if you see &#8220;hello world&#8221; then give yourself another hug, you have just run a web page from a server on your local computer, no internet connectivity required!  now you are finally ready to develop like the cool kids.</li>
</ol>
<p>Now, what did you just do?  well, if you care, here&#8217;s an explanation:</p>
<p>Your coldfusion server is located at the web address localhost:8500 (the :8500 is the port cf uses), coldfusion&#8217;s web root starts at the &#8216;wwwroot&#8217; folder, so anything you stick in there you can get to by knowing it&#8217;s file path from the wwwroot folder and tacking it on the end.  most of the time, you will organize your websites into folders in the wwwroot folder to keep them separated easier.  So your awesomeLawnCare.com site would be in wwwroot/awesomeLawnCare, for example.</p>
<p>If you are wondering to yourself, and what about the mySql and navicat i just installed, how did that fit in?  Well, it didn&#8217;t just yet. Later I&#8217;ll walk through using a database, that&#8217;s just a whole new level of craziness if you&#8217;ve not done anything with programming before.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=149</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Facebook Graph API to add an Event for a Page from a 3rd Party Site</title>
		<link>http://www.triadwebcrafters.com/blog/?p=140</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=140#comments</comments>
		<pubDate>Mon, 27 Dec 2010 21:10:44 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=140</guid>
		<description><![CDATA[I&#8217;m working on a project where a user wanted to be able to add events to their fan pages on Facebook as well as their personal web page. Since it was an uphill battle to get any useful information on doing this, I thought I&#8217;d share a step by step tutorial of how to accomplish [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a project where a user wanted to be able to add events to their fan pages on Facebook as well as their personal web page. Since it was an uphill battle to get any useful information on doing this, I thought I&#8217;d share a step by step tutorial of how to accomplish this, starting from square one.</p>
<h3>Square One: Setting up your App</h3>
<ol>
<li>Log in to Facebook. </li>
<li>Go to <a href="http://developers.facebook.com/setup/">http://developers.facebook.com/setup/</a> to set up your app.<br /><img src="createApp.jpg" /></li>
<li>You should now see your app&#8217;s information, but just for good measure, go to <a href="http://www.facebook.com/developers">facebook.com/developers</a> to get to more of your app&#8217;s information.  You will have to allow the developers app permission.  This will be where to go to configure your app&#8217;s information or look at stats for it at any later point in time.<br /><img src="developerAppPermission.jpg" /></li>
</ol>
<h3>Square Two: Create a web page</h3>
<ol>
<li>Mine is called &#8220;addEvent.cfm&#8221;</li>
<li>Add a pointer to your <a href="http://www.jquery.com">jQuery.js</a> file, wherever that is.  Your life will be easier if you embrace jQuery. Statement of fact.</li>
</ol>
<h3>Square Three: Start hooking Facebook in to your site</h3>
<p>If you are developing in IE, STOP IT!  Download <a href="http://www.mozilla.com">Firefox</a> and bask in its glory.  If you don&#8217;t already have it installed, be sure to install <a href="http://www.getfirebug.com">Firebug extension for Firefox</a> &#038; activate it immediately.  It will come in handy for debugging the AJAX you haven&#8217;t written yet, as well as any other problem you will ever have.</p>
<p>We&#8217;re going to add a login with Facebook button to the page.  Luckily, if you can find it, <a href="http://developers.facebook.com/docs/guides/web#login">Facebook has you covered</a>.  Just copy and paste in as they instruct (remember, you will need the app ID you just created at square 1), load up your page, and viola! you have a login button!</p>
<p>The beauty of the facebook single sign on is that it will go ahead and set a cookie for your site.  You can do a dump of the cookie scope and you will see a lovely cookie with a bunch of jibberish, entitled fbs_(your app id).</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfdump</span> <span style="color: #000000; font-weight: bold;">var</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#cookie#&quot;</span><span style="color: #0000FF;">&gt;</span></span> 
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>#cookie.fbs_(your appID)#<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Since this cookie really IS a bunch of gibberish (meaningful, but still gibberish), I decided to create a .cfm file that wrote more useful cookies if a user successfully signed on. Inside of the single sign-on code, we will place an AJAX request that fires to a separate coldfusion page that will write the cookies.  There is probably a way to do this without using CF at all, but I didn&#8217;t look it up.</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;"> FB.init({appId: 'your app id', status: true, cookie: true, xfbml: true});
 FB.Event.subscribe('auth.sessionChange', function(response){
  if(response.session){
   accessKey = response.session.access_token;
   fbUid = response.session.uid;
   $(document).fillPageOpts();//get the access key and fill in the pages we could post to
   $.ajax({//set cookies
    url: &quot;setCookies.cfm&quot;,
    data: {
     accessKey: response.session.access_token,
     fbUid: response.session.uid,
    },
    type: &quot;post&quot;,
    dataType: &quot;json&quot;
   });//end ajax
  }
  else{// The user has logged out, and the cookie has been cleared
   $('##error').show();
  }
 });</pre></div></div>

<p>And here is our page that assigns the cookies:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> frmLen <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">listLen</span><span style="color: #0000FF;">&#40;</span>form.fieldnames<span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
{<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> <span style="color: #0000FF;">structKeyExists</span><span style="color: #0000FF;">&#40;</span>form, <span style="color: #009900;">&quot;accessKey&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#frmLen#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfcookie</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#lcase(listGetAt(form.fieldnames, i))#&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#form[listGetAt(form.fieldnames, i)]#&quot;</span> expires<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;never&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  #lcase(listGetAt(form.fieldnames, i))# : #form[listGetAt(form.fieldnames, i)]#
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>}
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>You can see it&#8217;s very simple, and will return a JSON response.</p>
<p>Because the user could already be signed in, add this to the addEvent page in your script at the top to default to the cookie values:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> <span style="color: #0000FF;">structKeyExists</span><span style="color: #0000FF;">&#40;</span>cookie, <span style="color: #009900;">&quot;accessKey&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---do we already have a cookie?  if so, set our vars accordingly---&gt;</span>
  accessKey = '<span style="color: #0000FF;">#cookie.<span style="color: #0000FF;">accessKey</span>#</span>';
  fbUid = '<span style="color: #0000FF;">#cookie.fbUid#</span>';
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<h3>Square Four: Create a form</h3>
<p>According to the <a href="http://developers.facebook.com/docs/reference/api/event/">Facebook Graph API Events Documentation</a>, you will need to send the event&#8217;s title, start_time, end_time &#038; access_token in to create a new event.  Ok.  So let&#8217;s make a form that has those in it.  I have added a couple of optional parameters to my form as well.  you will also notice I have added an &#8220;_fb&#8221; to the end of each form name.  More on this momentarily.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"> &lt;form name=&quot;addEvent&quot; id=&quot;addEvent&quot; class=&quot;hide&quot; action=&quot;##&quot; method=&quot;post&quot;&gt;
  &lt;label for=&quot;name&quot;&gt;Event Name:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;name_fb&quot; id=&quot;eventName&quot; /&gt;&lt;br /&gt;
  &lt;label for=&quot;start_time&quot;&gt;Start Time:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;start_time_fb&quot; /&gt;&lt;br /&gt;
  &lt;label for=&quot;end_time&quot;&gt;End Time:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;end_time_fb&quot; /&gt;&lt;br /&gt;
  &lt;label for=&quot;location&quot;&gt;Location:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;location_fb&quot; /&gt;&lt;br /&gt;
  &lt;label for=&quot;venue&quot;&gt;Venue:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;venue_fb&quot; /&gt;&lt;br /&gt;
  &lt;label for=&quot;privacy&quot;&gt;Privacy:&lt;/label&gt;
  &lt;select name=&quot;privacy_fb&quot;&gt;
   &lt;option value=&quot;OPEN&quot;&gt;Open&lt;/option&gt;
   &lt;option value=&quot;CLOSED&quot;&gt;Closed&lt;/option&gt;
   &lt;option value=&quot;SECRET&quot;&gt;Secret&lt;/option&gt;
  &lt;/select&gt;&lt;br /&gt;
  &lt;label for=&quot;access_token_fb&quot;&gt;Page:&lt;/label&gt; 
  &lt;select name=&quot;access_token_fb&quot; id=&quot;accessKey&quot;&gt;
  &lt;/select&gt;&lt;br /&gt;
  &lt;input type=&quot;button&quot; value=&quot;Create Event&quot; id=&quot;sendEvent&quot; /&gt;
 &lt;/form&gt;</pre></div></div>

<p>Excellent.  However, all of this is completely useless as it is currently because we are missing a key ingredient: the access_token &#8212; and not the access_token for the USER, the access token for the PAGE.  This brings us to&#8230;</p>
<h3>Square Five: Obtaining the page access token &#038; selecting which page to add an event for</h3>
<p>This is a very important step, because without it, you will be posting events to YOUR profile, not your PAGE&#8217;s profile.  First, you will need to have your app request permission to manage pages (not events, like you would think).  Luckily, this is stupidly easy.  Just add this attribute to your fb:login button, as depicted below:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"> &lt;fb:login-button perms=&quot;manage_pages&quot;&gt;&lt;/fb:login-button&gt;</pre></div></div>

<p>Now, when a user logs in using your login button, they will have to allow permission to use your app.   This will also give you the right to manage pages on their behalf.  Let&#8217;s get into that now.  First, we need to see what pages the user admins, so we will fire off this AJAX request (note: i made this into a jQuery plugin as it is needed at 2 places on my page):</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;"> (function($){
  $.fn.fillPageOpts = function(){
   $.ajax({//what pages does the user admin?
    url: &quot;https://graph.facebook.com/&quot; + fbUid + &quot;/accounts?access_token=&quot; + accessKey,
    type: &quot;get&quot;,
    dataType: &quot;jsonp&quot;,
    success: function(d, t, x){//loop through each page and add it to the dropdown list
     $.each(d.data, function(id, val){
      $('##accessKey').append('&lt;option value=\&quot;' + val.access_token + '\&quot;&gt;' + val.name + '(' + val.category + ')&lt;/option&gt;');
     });
    }
   });//end ajax
   $('##addEvent').fadeIn(200);//show the form
  }
 })(jQuery);</pre></div></div>

<p>This returns a list of all pages the user can admin, and will give you a list of all of the <strong>PAGE&#8217;s Access Tokens</strong> so you can add events on the page&#8217;s behalf, not the user&#8217;s.  I&#8217;m looping through all of the items returned and feeding them in to the form created at Square Four.</p>
<h3>Square Six: Adding a handler</h3>
<p>At this point, you think you&#8217;re locked and loaded, just shoot the form over to FB via AJAX, and you&#8217;re set. False.  AJAX didn&#8217;t remote over so well for me, so I had to create a cfhttp request do do the work for me.  I stuck this in a .cfm, although it would probably be better suited for a function in a .cfc.  Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> frmLen <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">listLen</span><span style="color: #0000FF;">&#40;</span>form.fieldnames<span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfhttp</span> <span style="color: #0000FF;">method</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Post&quot;</span> url<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;https://graph.facebook.com/events&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#frmLen#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfhttpparam</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;formfield&quot;</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#lcase(left(listGetAt(form.fieldnames, i), len(listGetAt(form.fieldnames, i)) -3))#&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#form[listGetAt(form.fieldnames, i)]#&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfhttp</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #0000FF;">#cfhttp.filecontent#</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>The nice thing here is that you will get back a JSON response from facebook that you can use to display a link or whatever to your newly created event.  Here&#8217;s the jquery to fire this request &#038; handle the return:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;"> $(document).ready(function(){
  $('##sendEvent').click(function(){//send the event to FB to get added.
   $('##error').hide();
   $.ajax({
    url: &quot;postToFb.cfm&quot;,
    type: &quot;post&quot;,
    dataType: &quot;json&quot;,
    data: $('##addEvent').serializeArray(),
    success: function(d, t, x){
     $('##eventsAdded').prepend('&lt;li&gt;&lt;a href=\&quot;http://www.facebook.com/event.php?eid=' + d.id +'\&amp;index=1&quot; target=\&quot;_blank\&quot;&gt;' + $('##eventName').val() + '&lt;/a&gt;&lt;/li&gt;')
      .fadeIn(200);
    },
    error: function(x, t, e){
     $('##error').show();
    }
   });//end ajax
  });
 });</pre></div></div>

<h3>Square Seven: Finishing touches</h3>
<p>Since we modularized the event sender, we need to go back and call it on page load if the user is already logged in, add to the code you already have:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"> <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> <span style="color: #0000FF;">structKeyExists</span><span style="color: #0000FF;">&#40;</span>cookie, <span style="color: #009900;">&quot;accessKey&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---do we already have a cookie?  if so, set our vars accordingly---&gt;</span>
  accessKey = '<span style="color: #0000FF;">#cookie.<span style="color: #0000FF;">accessKey</span>#</span>';
  fbUid = '<span style="color: #0000FF;">#cookie.fbUid#</span>';
  $(document).fillPageOpts();//get the access key and fill in the pages we could post to
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Now, I like a little css to make things prettier and easier to use:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
.<span style="color: #993333;">hide</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.error<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F00</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#addEventWrapper</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">600px</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#addEventWrapper</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">600px</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#addEvent</span> label<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">125px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>And there you have it.  Hopefully this will help someone out there!</p>
<p>Let&#8217;s look at the complete page:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #0000FF;">http-equiv</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Content-Type&quot;</span> <span style="color: #0000FF;">content</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/html; charset=iso-8859-1&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">title</span><span style="color: #0000FF;">&gt;</span></span>Add a Facebook Event<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">title</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">style</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/css&quot;</span><span style="color: #0000FF;">&gt;</span></span>
.hide{
 display: none;
}
.error{
 color: #F00;
 font-weight: bold;
}
.right{
 float: right;
}
#addEventWrapper{
 width: 600px
}
#addEventWrapper{
 width: 600px
}
#addEvent label{
 display: inline-block;
 text-align: right;
 width: 125px;
}
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">style</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">script</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/javascript&quot;</span> <span style="color: #0000FF;">src</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;http://www.triadwebcrafters.com/lib/js/jQuery.js&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">script</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">script</span> <span style="color: #0000FF;">src</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;http://connect.facebook.net/en_US/all.js&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">script</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">body</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;addEventWrapper&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;eventsAdded&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;right hide&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ul</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;fb-root&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span>fb:login-button perms<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;manage_pages&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span>fb:login-button<span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;error&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;error hide&quot;</span><span style="color: #0000FF;">&gt;</span></span>Error Occurred<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">form</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;addEvent&quot;</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;addEvent&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;hide&quot;</span> <span style="color: #0000FF;">action</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;##&quot;</span> <span style="color: #0000FF;">method</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;post&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;name&quot;</span><span style="color: #0000FF;">&gt;</span></span>Event Name:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">input</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text&quot;</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;name_fb&quot;</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;eventName&quot;</span> <span style="color: #0000FF;">/&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;start_time&quot;</span><span style="color: #0000FF;">&gt;</span></span>Start Time:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">input</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text&quot;</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;start_time_fb&quot;</span> <span style="color: #0000FF;">/&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;end_time&quot;</span><span style="color: #0000FF;">&gt;</span></span>End Time:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">input</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text&quot;</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;end_time_fb&quot;</span> <span style="color: #0000FF;">/&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;location&quot;</span><span style="color: #0000FF;">&gt;</span></span>Location:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">input</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text&quot;</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;location_fb&quot;</span> <span style="color: #0000FF;">/&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;venue&quot;</span><span style="color: #0000FF;">&gt;</span></span>Venue:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">input</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text&quot;</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;venue_fb&quot;</span> <span style="color: #0000FF;">/&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;privacy&quot;</span><span style="color: #0000FF;">&gt;</span></span>Privacy:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">select</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;privacy_fb&quot;</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">option</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;OPEN&quot;</span><span style="color: #0000FF;">&gt;</span></span>Open<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">option</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">option</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;CLOSED&quot;</span><span style="color: #0000FF;">&gt;</span></span>Closed<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">option</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">option</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;SECRET&quot;</span><span style="color: #0000FF;">&gt;</span></span>Secret<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">option</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">select</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">label</span> <span style="color: #0000FF;">for</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;access_token_fb&quot;</span><span style="color: #0000FF;">&gt;</span></span>Page:<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">label</span><span style="color: #0000FF;">&gt;</span></span> 
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">select</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;access_token_fb&quot;</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;accessKey&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">select</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">br</span> <span style="color: #0000FF;">/&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">input</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;button&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Create Event&quot;</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sendEvent&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">form</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">script</span><span style="color: #0000FF;">&gt;</span></span>
 var accessKey = '', fbUid = '', pageAccessKey = '';
 (function($){
  $.fn.fillPageOpts = function(){
   $.ajax({//what pages does the user admin?
    url: &quot;https://graph.facebook.com/&quot; + fbUid + &quot;/accounts?access_token=&quot; + accessKey,
    type: &quot;get&quot;,
    dataType: &quot;jsonp&quot;,
    success: function(d, t, x){//loop through each page and add it to the dropdown list
     $.each(d.data, function(id, val){
      $('##accessKey').append('<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">option</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span>\<span style="color: #009900;">&quot;' + val.access_token + '<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;</span></span>' + val.name + '(' + val.category + ')<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">option</span><span style="color: #0000FF;">&gt;</span></span>');
     });
    }
   });//end ajax
   $('##addEvent').fadeIn(200);//show the form
  }
 })(jQuery);
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> <span style="color: #0000FF;">structKeyExists</span><span style="color: #0000FF;">&#40;</span>cookie, <span style="color: #009900;">&quot;accessKey&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---do we already have a cookie?  if so, set our vars accordingly---&gt;</span>
  accessKey = '<span style="color: #0000FF;">#cookie.<span style="color: #0000FF;">accessKey</span>#</span>';
  fbUid = '<span style="color: #0000FF;">#cookie.fbUid#</span>';
  $(document).fillPageOpts();//get the access key and fill in the pages we could post to
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
 FB.init({appId: '(your app id)', status: true, cookie: true, xfbml: true});
 FB.Event.subscribe('auth.sessionChange', function(response){
  if(response.session){
   accessKey = response.session.access_token;
   fbUid = response.session.uid;
   $(document).fillPageOpts();//get the access key and fill in the pages we could post to
   $.ajax({//set cookies
    url: &quot;setCookies.cfm&quot;,
    data: {
     accessKey: response.session.access_token,
     fbUid: response.session.uid,
    },
    type: &quot;post&quot;,
    dataType: &quot;json&quot;
   });//end ajax
  }
  else{// The user has logged out, and the cookie has been cleared
   $('##error').show();
  }
 });
 $(document).ready(function(){
  $('##sendEvent').click(function(){//send the event to FB to get added.
   $('##error').hide();
   $.ajax({
    url: &quot;postToFb.cfm&quot;,
    type: &quot;post&quot;,
    dataType: &quot;json&quot;,
    data: $('##addEvent').serializeArray(),
    success: function(d, t, x){
     $('##eventsAdded').prepend('<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">a</span> <span style="color: #0000FF;">href</span><span style="color: #0000FF;">=</span>\<span style="color: #009900;">&quot;http://www.facebook.com/event.php?eid=' + d.id +'<span style="color: #000099; font-weight: bold;">\&amp;</span>index=1&quot;</span> <span style="color: #0000FF;">target</span><span style="color: #0000FF;">=</span>\<span style="color: #009900;">&quot;_blank<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;</span></span>' + $('##eventName').val() + '<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">a</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>')
      .fadeIn(200);
    },
    error: function(x, t, e){
     $('##error').show();
    }
   });//end ajax
  });
 });
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">script</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">body</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">html</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<h3><a href="http://www.triadwebcrafters.com/standalone/postFBEvent/addEvent.cfm" target="_blank">View the Standalone</a></h3>
<h3><a href="http://www.triadwebcrafters.com/standalone/zipped/postFBEvent.zip">Download Source Code</a></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=140</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A simple jQuery &amp; Coldfusion Slider</title>
		<link>http://www.triadwebcrafters.com/blog/?p=110</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=110#comments</comments>
		<pubDate>Tue, 21 Dec 2010 21:32:45 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[xhtml/css]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[slider]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=110</guid>
		<description><![CDATA[Today I&#8217;m building an app for displaying products in a fairly small store. Rather than reload the page every time we want to see the next page of results, I&#8217;m going to load all of my results into one large div and slide it around to only show certain items at a time. The jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m building an app for displaying products in a fairly small store.  Rather than reload the page every time we want to see the next page of results, I&#8217;m going to load all of my results into one large div and slide it around to only show certain items at a time.  The jQuery required for making this slick little app is pretty minimal, as most of the work is done with some simple css.</p>
<p>Here is the idea:</p>
<ol>
<li>create a div that is a specific pixel size, and be sure the overflow is set to hidden.</li>
<li>create another div inside of the first with a set width of 9999em (we will be scrolling horizontally, not vertically) to make it easily large enough to hold any data we need to display.</li>
<li>inside of this very long div, place a div for each page, floated left &#038; set to the same pixel size as your very first div.</li>
<li>put your content for each page in.</li>
<li>use jquery to move a set pixel with in the specified direction.</li>
<li>the end</li>
</ol>
<p>Here is a working example of what I came up with:</p>
<p><script type="text/javascript" src="http://www.triadwebcrafters.com/lib/js/jQuery.js"></script></head></p>
<style type="text/css">
#sliderWrapper{
 width: 336px;
 overflow: hidden;
 position: relative;
 border: 1px solid #CCC;
}
#sliderContent{
 width: 9999em;
}
#sliderContent div.sliderPage{
 float: left;
 border:#CCC;
 width: 336px;
}
#sliderContent div.sliderPage div.sliderItem{
 float: left;
 background-color:#CCC;
 border: 1px solid #000;
 width: 100px;
 height: 125px;
 padding: 5px;
}
.hovery{
 cursor: pointer;
}
</style>
<div id="pageNav"><span id="reverse" class="hovery"><</span> <span class="pageNumber hovery">1</span> <span class="pageNumber hovery">2</span> <span class="pageNumber hovery">3</span> <span class="pageNumber hovery">4</span> <span class="pageNumber hovery">5</span> <span id="forward" class="hovery">></span></div>
<div id="sliderWrapper">
<div id="sliderContent">
<div id="sliderPage0" class="sliderPage">
<div id="item1" class="sliderItem">Item 1</div>
<div id="item2" class="sliderItem">Item 2</div>
<div id="item3" class="sliderItem">Item 3</div>
<div id="item4" class="sliderItem">Item 4</div>
<div id="item5" class="sliderItem">Item 5</div>
<div id="item6" class="sliderItem">Item 6</div>
<div id="item7" class="sliderItem">Item 7</div>
<div id="item8" class="sliderItem">Item 8</div>
<div id="item9" class="sliderItem">Item 9</div>
<div id="item10" class="sliderItem">Item 10</div>
<div id="item11" class="sliderItem">Item 11</div>
<div id="item12" class="sliderItem">Item 12</div>
</p></div>
<div id="sliderPage1" class="sliderPage">
<div id="item13" class="sliderItem">Item 13</div>
<div id="item14" class="sliderItem">Item 14</div>
<div id="item15" class="sliderItem">Item 15</div>
<div id="item16" class="sliderItem">Item 16</div>
<div id="item17" class="sliderItem">Item 17</div>
<div id="item18" class="sliderItem">Item 18</div>
<div id="item19" class="sliderItem">Item 19</div>
<div id="item20" class="sliderItem">Item 20</div>
<div id="item21" class="sliderItem">Item 21</div>
<div id="item22" class="sliderItem">Item 22</div>
<div id="item23" class="sliderItem">Item 23</div>
<div id="item24" class="sliderItem">Item 24</div>
</p></div>
<div id="sliderPage2" class="sliderPage">
<div id="item25" class="sliderItem">Item 25</div>
<div id="item26" class="sliderItem">Item 26</div>
<div id="item27" class="sliderItem">Item 27</div>
<div id="item28" class="sliderItem">Item 28</div>
<div id="item29" class="sliderItem">Item 29</div>
<div id="item30" class="sliderItem">Item 30</div>
<div id="item31" class="sliderItem">Item 31</div>
<div id="item32" class="sliderItem">Item 32</div>
<div id="item33" class="sliderItem">Item 33</div>
<div id="item34" class="sliderItem">Item 34</div>
<div id="item35" class="sliderItem">Item 35</div>
<div id="item36" class="sliderItem">Item 36</div>
</p></div>
<div id="sliderPage3" class="sliderPage">
<div id="item37" class="sliderItem">Item 37</div>
<div id="item38" class="sliderItem">Item 38</div>
<div id="item39" class="sliderItem">Item 39</div>
<div id="item40" class="sliderItem">Item 40</div>
<div id="item41" class="sliderItem">Item 41</div>
<div id="item42" class="sliderItem">Item 42</div>
<div id="item43" class="sliderItem">Item 43</div>
<div id="item44" class="sliderItem">Item 44</div>
<div id="item45" class="sliderItem">Item 45</div>
<div id="item46" class="sliderItem">Item 46</div>
<div id="item47" class="sliderItem">Item 47</div>
<div id="item48" class="sliderItem">Item 48</div>
</p></div>
<div id="sliderPage4" class="sliderPage">
<div id="item49" class="sliderItem">Item 49</div>
<div id="item50" class="sliderItem">Item 50</div>
</p></div>
</p></div>
</div>
<p><script type="text/javascript">
 $(document).ready(function(){
  var currentPage = 1;//this holds what page we are currently on.
  $('#pageNav .pageNumber').click(function(){//jump to a particular page.
   var goToPage = $(this).html();//get the page number
   currentPage = goToPage;//set the current page
   $('#sliderContent').animate(
    {marginLeft: '-' + ((goToPage - 1) * 336) + 'px'},
    500);//make the page move.
  });
  $('#forward').click(function(){//go forward 1 page
   if(currentPage <5){//make sure we are not at the end of the pages
    $('#sliderContent').animate(
     {marginLeft: '-' + (currentPage * 336) + 'px'},
     500);//move page
    currentPage++;//add 1 to current page
   }
  });
  $('#reverse').click(function(){
   if(currentPage > 1){//make sure we are not on the first page
    $('#sliderContent').animate(
     {marginLeft: '-' + ((currentPage-2) * 336) + 'px'},
     500);//move page
    currentPage--;//subtract 1 from current page
   }
  });
 });
</script></p>
<p>And here is the fully commented version of the code:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #0000FF;">http-equiv</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Content-Type&quot;</span> <span style="color: #0000FF;">content</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/html; charset=iso-8859-1&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">title</span><span style="color: #0000FF;">&gt;</span></span>My Sweet Slider<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">title</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">script</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/javascript&quot;</span> <span style="color: #0000FF;">src</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;my_jQuery_file.js&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">script</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">style</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/css&quot;</span><span style="color: #0000FF;">&gt;</span></span>
#sliderWrapper{
 width: 336px;
 overflow: hidden;
 position: relative;
 border: 1px solid #CCC;
}
#sliderContent{
 width: 9999em;
}
#sliderContent div.sliderPage{
 float: left;
 border:#CCC;
 width: 336px;
}
#sliderContent div.sliderPage div.sliderItem{
 float: left;
 background-color:#CCC;
 border: 1px solid #000;
 width: 100px;
 height: 125px;
 padding: 5px;
}
.hovery{
 cursor: pointer;
}
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">style</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">body</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> pageNum<span style="color: #0000FF;">=</span><span style="color: #0000FF;">ceiling</span><span style="color: #0000FF;">&#40;</span><span style="color: #FF0000;">50</span><span style="color: #0000FF;">/</span><span style="color: #FF0000;">12</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---how many pages do we have?---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;pageNav&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">span</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;reverse&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;hovery&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;&lt;/</span><span style="color: #000000; font-weight: bold;">span</span><span style="color: #0000FF;">&gt;&lt;</span>!---back button---<span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #808080; font-style: italic;">&lt;!---loop through and display all pages.---&gt;</span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#pageNum#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">span</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;pageNumber hovery&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #0000FF;">#i#</span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">span</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">span</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;forward&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;hovery&quot;</span><span style="color: #0000FF;">&gt;</span></span>&gt;<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">span</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---forward button---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderWrapper&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderContent&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderPage0&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderPage&quot;</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;50&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---loop through all of the items---&gt;</span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;item#i#&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderItem&quot;</span><span style="color: #0000FF;">&gt;</span></span>Item <span style="color: #0000FF;">#i#</span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> not i mod <span style="color: #FF0000;">12</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---since we only want 12 items per page, have this next part execute every 12th loop---&gt;</span>
     <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---close the old div &amp; start a new one---&gt;</span>
     <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderPage#i/12#&quot;</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;sliderPage&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">script</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/javascript&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 $(document).ready(function(){
  var currentPage = 1;//this holds what page we are currently on.
  $('##pageNav .pageNumber').click(function(){//jump to a particular page.
   var goToPage = $(this).html();//get the page number
   currentPage = goToPage;//set the current page
   $('##sliderContent').animate(
    {marginLeft: '-' + ((goToPage - 1) * 336) + 'px'},
    500);//make the page move.
    return false; //just to keep the anchor tags from doing anything.
  });
  $('##forward').click(function(){//go forward 1 page
   if(currentPage <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span> #variables.pageNum#<span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&#123;</span><span style="color: #808080; font-style: italic;">//make sure we are not at the end of the pages</span></span>
<span style="color: #333333;">    $<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">'##sliderContent'</span><span style="color: #0000FF;">&#41;</span>.animate<span style="color: #0000FF;">&#40;</span></span>
<span style="color: #333333;">     <span style="color: #0000FF;">&#123;</span>marginLeft: <span style="color: #009900;">'-'</span> + <span style="color: #0000FF;">&#40;</span>currentPage * <span style="color: #FF0000;">336</span><span style="color: #0000FF;">&#41;</span> + <span style="color: #009900;">'px'</span><span style="color: #0000FF;">&#125;</span>,</span>
<span style="color: #333333;">     <span style="color: #FF0000;">500</span><span style="color: #0000FF;">&#41;</span>;<span style="color: #808080; font-style: italic;">//move page</span></span>
<span style="color: #333333;">    currentPage++;<span style="color: #808080; font-style: italic;">//add 1 to current page</span></span>
<span style="color: #333333;">   <span style="color: #0000FF;">&#125;</span></span>
<span style="color: #333333;">  <span style="color: #0000FF;">&#125;</span><span style="color: #0000FF;">&#41;</span>;</span>
<span style="color: #333333;">  $<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">'##reverse'</span><span style="color: #0000FF;">&#41;</span>.click<span style="color: #0000FF;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&#123;</span></span>
<span style="color: #333333;">   <span style="color: #000000; font-weight: bold;">if</span><span style="color: #0000FF;">&#40;</span>currentPage <span style="color: #0000FF;">&gt;</span></span> 1){//make sure we are not on the first page
    $('##sliderContent').animate(
     {marginLeft: '-' + ((currentPage-2) * 336) + 'px'},
     500);//move page
    currentPage--;//subtract 1 from current page
   }
  });
 });
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">script</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">body</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">html</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p><a href="http://www.triadwebcrafters.com/standalone/single/slider.cfm" target="_blank">View the Standalone</a><br />
<a href='http://www.triadwebcrafters.com/standalone/zipped/slider.zip' >Download the Slider Source Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=110</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Basics 101- Part 2</title>
		<link>http://www.triadwebcrafters.com/blog/?p=108</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=108#comments</comments>
		<pubDate>Wed, 24 Nov 2010 15:44:22 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Website Basics]]></category>
		<category><![CDATA[xhtml/css]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=108</guid>
		<description><![CDATA[Rule of thumb: the closer to the element the style is, the more precedence it will take. From furthest away to closest, here is how styles will be assigned: 1.Browser Defaults: These styles are set by the client and are what appears when no other style rules apply. 1. order external stylesheets are included on [...]]]></description>
			<content:encoded><![CDATA[<p>Rule of thumb: the closer to the element the style is, the more precedence it will take.<br />
From furthest away to closest, here is how styles will be assigned:</p>
<p>1.Browser Defaults: These styles are set by the client and are what appears when no other style rules apply.</p>
<p>1. order external stylesheets are included on the page.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;style1.css&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;style2.css&quot; /&gt;</pre></div></div>

<p>so for all styles in style1 that have a matching style in style2, the ones in style2 will take precedence.</p>
<p>2. order styles in external stylesheets are included on the stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#this</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F00</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#this</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>will yield a color of #CCC and a background of #000, as the first #this will have its color overwritten by the second #this.</p>
<p>3. on-page styles:<br />
if a<br />
<style></style>
<p> tag is included on the page, styles inside of it will take precedence.  Again, styles in the tag are order sensitive, ascending to descending.</p>
<p>4. inline styles:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div style=&quot;color: #F00;&quot;&gt;&lt;/div&gt;</pre></div></div>

<p>5. important! styles: styles located ANYWHERE that are followed by !important will be, as the name indicates, most important.  If two !important tags are applied to teh same style element, the element that would normally take precedence with the !important tag will win.</p>
<p>Styles will also follow these rules:<br />
- elements with no style will inherit some styles from parent, closest being most important, furthest being least<br />
- for elements with both a class &#038; an ID, ID will take precedence over class level styles.<br />
- more specific IDs will take precedence.  This can also be the case with id &#038; class combinations:<br />
  Examples:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">  <span style="color: #cc00cc;">#parentOfThis</span> <span style="color: #cc00cc;">#this</span> <span style="color: #808080; font-style: italic;">/*will be used over #this*/</span>
  <span style="color: #cc00cc;">#parentOfThis</span> <span style="color: #6666ff;">.thisClass</span><span style="color: #cc00cc;">#this</span> <span style="color: #808080; font-style: italic;">/*will be used over .thisClass or .thisClass or #this*/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=108</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Basics 101</title>
		<link>http://www.triadwebcrafters.com/blog/?p=106</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=106#comments</comments>
		<pubDate>Wed, 24 Nov 2010 15:38:49 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Website Basics]]></category>
		<category><![CDATA[xhtml/css]]></category>
		<category><![CDATA[101]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[id]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=106</guid>
		<description><![CDATA[We will use this sample code as a reference: &#60;div id=&#34;sampleID&#34; class=&#34;sampleClass1 sampleClass2&#34;&#62; &#60;div id=&#34;childID&#34; class=&#34;sampleChild sampleClass2&#34;&#62; &#60;p class=&#34;sampleClass1&#34;&#62;Test &#60;span&#62;Text.&#60;/span&#62;&#60;/p&#62; &#60;/div&#62; &#60;/div&#62; css generally uses IDs, classes, and elements to assign a style to a particular element on an html page. Elements are the simplest to call. simply apply styles to the elemtn type. For [...]]]></description>
			<content:encoded><![CDATA[<p>We will use this sample code as a reference:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;sampleID&quot; class=&quot;sampleClass1 sampleClass2&quot;&gt;
 &lt;div id=&quot;childID&quot; class=&quot;sampleChild sampleClass2&quot;&gt;
  &lt;p class=&quot;sampleClass1&quot;&gt;Test &lt;span&gt;Text.&lt;/span&gt;&lt;/p&gt;
 &lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>css generally uses IDs, classes, and elements to assign a style to a particular element on an html page.  Elements are the simplest to call.  simply apply styles to the elemtn type.  For example:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>will apply a grey color to all anchor tags.</p>
<p>There are two major differences between IDs and classes:<br />
1. IDs should only be used once per html page, whereas classes can be reused.  Some browsers will have trouble rendering IDs if they appear on the page more than once.<br />
2. Classes can be compounded, meaning you can assign as many classes as you would like to an element.</p>
<p>To reference a particular ID, use &#8220;#&#8221; followed by the id name.<br />
#sampleID will reference the outer div.</p>
<p>to reference a particular class, use &#8220;.&#8221; followed by the class name.<br />
.sampleClass1</p>
<p>One can also specify where to apply styles more specifically. compounding style ids and classes will allow this to happen</p>
<p>For example,<br />
using the following style</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">.sampleClass2<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>would yield both divs having a grey border.  let&#8217;s say we only want to apply a grey border to the outer div:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#sampleID</span><span style="color: #6666ff;">.sampleClass2</span><span style="color: #00AA00;">&#123;</span> <span style="color: #808080; font-style: italic;">/*look for an ID called &quot;sampleID&quot; that also has a class of &quot;sampleClass2&quot;*/</span>
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sampleClass1</span>.sampleClass2<span style="color: #00AA00;">&#123;</span><span style="color: #808080; font-style: italic;">/*look for any elements with the classes &quot;sampleClass1 &amp; sampleClass2&quot;*/</span>
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>will both yield a border only on the outer div.</p>
<p>Now let&#8217;s take that same example, but instead only apply the grey border to the inner div.  there are several ways to accomplish this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#sampleID</span> <span style="color: #6666ff;">.sampleClass2</span><span style="color: #00AA00;">&#123;</span> <span style="color: #808080; font-style: italic;">/*look for any classes called &quot;sampleClass2&quot; with a parent ID called &quot;sampleID&quot;*/</span>
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#childID</span><span style="color: #6666ff;">.sampleClass2</span><span style="color: #00AA00;">&#123;</span> <span style="color: #808080; font-style: italic;">/*look for an ID called &quot;childID&quot; that also has a class of &quot;sampleClass2&quot;*/</span>
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sampleChild</span><span style="color: #6666ff;">.sampleClass2</span><span style="color: #00AA00;">&#123;</span> <span style="color: #808080; font-style: italic;">/*look for any elements with the classes &quot;sampleChild &amp; sampleClass2&quot;*/</span>
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Notice the space in the first example denotes looking for any children inside of the element listed first.  This will apply to ALL children of the element, not just direct children.<br />
So, if we wanted all paragraphs inside our sampleID to be red, we could say:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#sampleID</span> p<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F00</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>even though the &#8220;p&#8221; element is not a direct child of sampleID, since p falls inside of sampleID, the style will apply to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=106</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using a nested tree structure with coldfusion to create a dynamic menu</title>
		<link>http://www.triadwebcrafters.com/blog/?p=82</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=82#comments</comments>
		<pubDate>Thu, 21 Oct 2010 20:11:03 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[xhtml/css]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dropdowns]]></category>
		<category><![CDATA[nested tree]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=82</guid>
		<description><![CDATA[Let&#8217;s say we have a tree structure like below: top level second level top level second level third level third level fourth level third level second level first level There are basically two approaches to this problem: the classic parent/child relationship and the nested structure. Parent/child structure dictates that you need to know the parent [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say we have a tree structure like below:</p>
<ol>
<li>top level
<ol>
<li>second level</li>
</ol>
</li>
<li>top level
<ol>
<li>second level
<ol>
<li>third level</li>
<li>third level
<ol>
<li>fourth level</li>
</ol>
</li>
<li>third level</li>
</ol>
</li>
<li>second level</li>
</ol>
</li>
<li>first level</li>
</ol>
<p>There are basically two approaches to this problem: the classic parent/child relationship and the nested structure.  Parent/child structure dictates that you need to know the parent of a node, and the children that node has.  Armed with this information, you would do a recursive loop over the data to build a structure.  The problem with this method is that it&#8217;s costly to process and can get sloppy fast.  Enter nested tree structure.  The idea is to assign each node in the tree a &#8220;first&#8221; number and a &#8220;last&#8221; number.  So, for example, here would be the first &#038; last numbers for our tree above:</p>
<ol type="a">
<li>1-top level-4
<ol type="a">
<li>2-second level-3</li>
</ol>
</li>
<li>5-top level-18
<ol type="a">
<li>6-second level-15
<ol type="a">
<li>7-third level-8</li>
<li>9-third level-12
<ol type="a">
<li>10-fourth level-11</li>
</ol>
</li>
<li>13-third level-14</li>
</ol>
</li>
<li>16-second level-17</li>
</ol>
</li>
<li>19-first level-20</li>
</ol>
<p>Do you see the pattern?  any nodes with a first number between the first and last numbers of the selected node will be children of that node.  This simplifies our tree structure in 2 ways. first, we can easily run a query of the nodes we need for our dropdown menus and sort by the first num.  second, this makes looping over our list to display in a useful manner much faster and easier.  I have included below an example of how one could loop over the data to put items into nested lists.  For simplicity, I have defined all variables in an array/structure.  Obviously, to be useful this would better be implemented from a database.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!---Add some styling to make it sexy---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">style</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text/css&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 #dropdowns .secondary{
  display: none;
  position: absolute;
  left: 179px;
  top: -21px;
  margin: 0;
 }
 #dropdowns li:hover &gt; .secondary{
  display: block;
 }
 #dropdowns li{
  position: relative;
  color: #009;
  width: 175px;
  line-height: 25px;
  height: 25px;
  border: 1px solid #CCC;
  background-color: #DDD;
  list-style: none outside none;
  margin: 0;
  cursor: pointer;
  padding: 2px;
 }
 #dropdowns li:hover{
  border: 1px solid #AAA;
  background-color: #BBB;
  color: #FFF;
 }
 ol#dropdowns, #dropdowns ol{
  list-style: none outside none;
  padding: 20px 20px 20px 0;
 }
 .more{
 float: right;
 }
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">style</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
 mq = structNew();
 menuQry = arrayNew(1);
 menuQry[1] = structNew();
 menuQry[1]['controlName'] = &quot;top level&quot;;
 menuQry[1]['first'] = 1;
 menuQry[1]['last'] = 4;
 menuQry[1]['level'] = 1;
 menuQry[2] = structNew();
 menuQry[2]['controlName'] = &quot;second level&quot;;
 menuQry[2]['first'] = 2;
 menuQry[2]['last'] = 3;
 menuQry[2]['level'] = 2;
 menuQry[3] = structNew();
 menuQry[3]['controlName'] = &quot;top level&quot;;
 menuQry[3]['first'] = 5;
 menuQry[3]['last'] = 18;
 menuQry[3]['level'] = 1;
 menuQry[4] = structNew();
 menuQry[4]['controlName'] = &quot;second level&quot;;
 menuQry[4]['first'] = 6;
 menuQry[4]['last'] = 15;
 menuQry[4]['level'] = 2;
 menuQry[5] = structNew();
 menuQry[5]['controlName'] = &quot;third level&quot;;
 menuQry[5]['first'] = 7;
 menuQry[5]['last'] = 8;
 menuQry[5]['level'] = 3;
 menuQry[6] = structNew();
 menuQry[6]['controlName'] = &quot;third level&quot;;
 menuQry[6]['first'] = 9;
 menuQry[6]['last'] = 12;
 menuQry[6]['level'] = 3;
 menuQry[7] = structNew();
 menuQry[7]['controlName'] = &quot;fourth level&quot;;
 menuQry[7]['first'] = 10;
 menuQry[7]['last'] = 11;
 menuQry[7]['level'] = 4;
 menuQry[8] = structNew();
 menuQry[8]['controlName'] = &quot;third level&quot;;
 menuQry[8]['first'] = 13;
 menuQry[8]['last'] = 14;
 menuQry[8]['level'] = 3;
 menuQry[9] = structNew();
 menuQry[9]['controlName'] = &quot;second level&quot;;
 menuQry[9]['first'] = 16;
 menuQry[9]['last'] = 17;
 menuQry[9]['level'] = 2;
 menuQry[10] = structNew();
 menuQry[10]['controlName'] = &quot;first level&quot;;
 menuQry[10]['first'] = 19;
 menuQry[10]['last'] = 20;
 menuQry[10]['level'] = 1;
 mq.menuLen = arrayLen(menuQry);
 mq.childHide = 0;
 mq.onLevel = 1;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">ol</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;dropdowns&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">li</span> <span style="color: #0000FF;">style</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;display: none&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---first li will always be empty, so be sure it does not show.---&gt;</span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#mq.menuLen#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> mq.newLevel <span style="color: #0000FF;">=</span> menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.level - mq.onLevel<span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> mq.onLevel <span style="color: #0000FF;">=</span> menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.level<span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> mq.newLevel <span style="color: #0000FF;">eq</span> <span style="color: #FF0000;">1</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">span</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;more&quot;</span><span style="color: #0000FF;">&gt;</span></span>&gt;&gt;<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">span</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">ol</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;secondary&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelseif</span> mq.newLevel <span style="color: #0000FF;">lt</span> <span style="color: #FF0000;">0</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;-1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#mq.newLevel#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;j&quot;</span> step<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;-1&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ol</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelse</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>#menuQry[i].controlName#
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ol</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!---close all open lists---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#mq.onLevel#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;j&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ol</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Here is the working version:</p>
<style type="text/css">
 #dropdowns .secondary{
  display: none;
  position: absolute;
  left: 179px;
  top: -21px;
  margin: 0;
 }
 #dropdowns li:hover > .secondary{
  display: block;
 }
 #dropdowns li{
  position: relative;
  color: #009;
  width: 175px;
  line-height: 25px;
  height: 25px;
  border: 1px solid #CCC;
  background-color: #DDD;
  list-style: none outside none;
  margin: 0;
  cursor: pointer;
  padding: 2px;
 }
 #dropdowns li:hover{
  border: 1px solid #AAA;
  background-color: #BBB;
  color: #FFF;
 }
 ol#dropdowns, #dropdowns ol{
  list-style: none outside none;
  padding: 20px 20px 20px 0;
 }
 .more{
 float: right;
 }
</style>
<ol id="dropdowns">
<li>top level <span class="more">>></span>
<ol class="secondary">
<li>second level </li>
</ol>
</li>
<li>top level <span class="more">>></span>
<ol class="secondary">
<li>second level <span class="more">>></span>
<ol class="secondary">
<li>third level </li>
<li>third level <span class="more">>></span>
<ol class="secondary">
<li>fourth level </li>
</ol>
</li>
<li>third level </li>
</ol>
</li>
<li>second level </li>
</ol>
</li>
<li>first level </li>
</ol>
<p>There are plenty of ways to use this to your advantage.  I plan on using this method to implement menus for different types of users; the idea being I can filter my list items based on a user&#8217;s permissions and then dynamically build the list from the results.<br />
The problem with using the code above and filtering based on a user role (or whatever) is how to handle nodes that are filtered out.  Luckily, with a little extra code, we can still accomplish what we want:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
 mq = structNew();
 menuQry = arrayNew(1);//this would be replaced with a query outside of this exmaple.
 menuQry[1] = structNew();
 menuQry[1]['controlName'] = &quot;top level&quot;;
 menuQry[1]['first'] = 1;
 menuQry[1]['last'] = 4;
 menuQry[1]['level'] = 1;
 menuQry[1]['showItem'] = 1;//Now we add a boolean to say whether or not to display the list item.
 menuQry[2] = structNew();
 menuQry[2]['controlName'] = &quot;second level&quot;;
 menuQry[2]['first'] = 2;
 menuQry[2]['last'] = 3;
 menuQry[2]['level'] = 2;
 menuQry[2]['showItem'] = 1;
 menuQry[3] = structNew();
 menuQry[3]['controlName'] = &quot;top level&quot;;
 menuQry[3]['first'] = 5;
 menuQry[3]['last'] = 18;
 menuQry[3]['level'] = 1;
 menuQry[3]['showItem'] = 1;
 menuQry[4] = structNew();
 menuQry[4]['controlName'] = &quot;second level&quot;;
 menuQry[4]['first'] = 6;
 menuQry[4]['last'] = 15;
 menuQry[4]['level'] = 2;
 menuQry[4]['showItem'] = 0;
 menuQry[5] = structNew();
 menuQry[5]['controlName'] = &quot;third level&quot;;
 menuQry[5]['first'] = 7;
 menuQry[5]['last'] = 8;
 menuQry[5]['level'] = 3;
 menuQry[5]['showItem'] = 1;
 menuQry[6] = structNew();
 menuQry[6]['controlName'] = &quot;third level&quot;;
 menuQry[6]['first'] = 9;
 menuQry[6]['last'] = 12;
 menuQry[6]['level'] = 3;
 menuQry[6]['showItem'] = 1;
 menuQry[7] = structNew();
 menuQry[7]['controlName'] = &quot;fourth level&quot;;
 menuQry[7]['first'] = 10;
 menuQry[7]['last'] = 11;
 menuQry[7]['level'] = 4;
 menuQry[7]['showItem'] = 0;
 menuQry[8] = structNew();
 menuQry[8]['controlName'] = &quot;third level&quot;;
 menuQry[8]['first'] = 13;
 menuQry[8]['last'] = 14;
 menuQry[8]['level'] = 3;
 menuQry[8]['showItem'] = 1;
 menuQry[9] = structNew();
 menuQry[9]['controlName'] = &quot;second level&quot;;
 menuQry[9]['first'] = 16;
 menuQry[9]['last'] = 17;
 menuQry[9]['level'] = 2;
 menuQry[9]['showItem'] = 1;
 menuQry[10] = structNew();
 menuQry[10]['controlName'] = &quot;first level&quot;;
 menuQry[10]['first'] = 19;
 menuQry[10]['last'] = 20;
 menuQry[10]['level'] = 1;
 menuQry[10]['showItem'] = 0;
 mq.menuLen = arrayLen(menuQry);
 mq.childHide = 0;
 mq.onLevel = 1;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">ol</span> <span style="color: #0000FF;">id</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;dropdowns&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">li</span> <span style="color: #0000FF;">style</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;display: none&quot;</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---first li will always be empty, so be sure it does not show.---&gt;</span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#mq.menuLen#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> mq.childHide <span style="color: #0000FF;">eq</span> <span style="color: #FF0000;">0</span> and menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.showItem <span style="color: #0000FF;">eq</span> <span style="color: #FF0000;">0</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---is this one supposed to hide, and is it the first child?---&gt;</span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> mq.childHide <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">&#40;</span>menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.last - menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.first - <span style="color: #FF0000;">1</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">/</span><span style="color: #FF0000;">2</span> + <span style="color: #FF0000;">1</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> mq.childHide <span style="color: #0000FF;">eq</span> <span style="color: #FF0000;">0</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> mq.newLevel <span style="color: #0000FF;">=</span> menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.level - mq.onLevel<span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> mq.onLevel <span style="color: #0000FF;">=</span> menuQry<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</span>.level<span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> mq.newLevel <span style="color: #0000FF;">eq</span> <span style="color: #FF0000;">1</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">span</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;more&quot;</span><span style="color: #0000FF;">&gt;</span></span>&gt;&gt;<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">span</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">ol</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;secondary&quot;</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelseif</span> mq.newLevel <span style="color: #0000FF;">lt</span> <span style="color: #FF0000;">0</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;-1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#mq.newLevel#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;j&quot;</span> step<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;-1&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ol</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelse</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>#menuQry[i].controlName#
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelse</span><span style="color: #0000FF;">&gt;</span></span>
   <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> mq.childHide <span style="color: #0000FF;">=</span> mq.childHide - <span style="color: #FF0000;">1</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!---count down---&gt;</span>
  <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ol</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!---close all open lists---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#mq.onLevel#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;j&quot;</span><span style="color: #0000FF;">&gt;</span></span>
 <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">li</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">ol</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>And the result of this code is below:</p>
<ol id="dropdowns">
<li style="display: none"> </li>
<li>top level <span class="more">>></span>
<ol class="secondary">
<li>second level </li>
</ol>
</li>
<li>top level <span class="more">>></span>
<ol class="secondary">
<li>second level </li>
</ol>
</li>
</ol>
<p>Lovely!  This logic could also be implemented in a .cfc as a long string then stored in cache to keep from having to run this script on every page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=82</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Implementing openID on an existing website</title>
		<link>http://www.triadwebcrafters.com/blog/?p=73</link>
		<comments>http://www.triadwebcrafters.com/blog/?p=73#comments</comments>
		<pubDate>Thu, 14 Oct 2010 13:59:31 +0000</pubDate>
		<dc:creator>Jessica Kennedy</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[openID]]></category>

		<guid isPermaLink="false">http://www.triadwebcrafters.com/blog/?p=73</guid>
		<description><![CDATA[I&#8217;m beginning a project to add the option to sign in via openIDs like Facebook or Google to a website with an existing user database. The concept is pretty straightforward on the surface&#8211; let someone else authenticate my users. Of course, one then runs in to the issue of how to associate an openID with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m beginning a project to add the option to sign in via openIDs like Facebook or Google to a website with an existing user database.  The concept is pretty straightforward on the surface&#8211; let someone else authenticate my users.  Of course, one then runs in to the issue of how to associate an openID with one of your existing user&#8217;s accounts to avoid duplicate accounts on your end.  I did a little digging and found a very thorough outline <a href="http://www.plaxo.com/api/openid_recipe">here&#8230; openID Implementation</a>.</p>
<p>I&#8217;ll try to post more on this as there isn&#8217;t tons of info on CF implementations of openID.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.triadwebcrafters.com/blog/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

