<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>jensbits.com</title>
	
	<link>http://www.jensbits.com</link>
	<description />
	<lastBuildDate>Fri, 13 Nov 2009 01:29:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/jensbits" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Positioning Multiple jQuery UI Dialogs</title>
		<link>http://www.jensbits.com/2009/11/12/positioning-multiple-jquery-ui-dialogs/</link>
		<comments>http://www.jensbits.com/2009/11/12/positioning-multiple-jquery-ui-dialogs/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 01:29:09 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=472</guid>
		<description><![CDATA[This post shows one way to position multiple jQuery UI dialogs on the same page. It positions the dialog over the calling button based on the button&#8217;s position in the viewport.
The dialog box contents can be placed anywhere in the body. For this example they look like this:

&#60;div id=&#34;helpDialog1&#34; title=&#34;Help &#62;&#62; Dialog 1&#34;&#62;
   [...]]]></description>
			<content:encoded><![CDATA[<p>This post shows one way to position multiple <a href="http://jqueryui.com/demos/dialog/">jQuery UI dialogs</a> on the same page. It positions the dialog over the calling button based on the button&#8217;s position in the viewport.</p>
<p>The dialog box contents can be placed anywhere in the body. For this example they look like this:</p>
<pre class="brush: xml;">
&lt;div id=&quot;helpDialog1&quot; title=&quot;Help &gt;&gt; Dialog 1&quot;&gt;
        &lt;p&gt;In id imperdiet justo. Sed eu commodo erat. Nullam euismod dapibus magna a porttitor. Vestibulum odio turpis, ullamcorper eu ullamcorper sit amet, blandit id purus. Suspendisse commodo egestas augue, et fringilla lorem consequat et. Sed volutpat sapien at massa gravida sollicitudin. Nunc ut nibh orci.&lt;/p&gt;
        &lt;p&gt;Nam quis odio vel arcu auctor tincidunt. Aenean vulputate, sapien id porttitor placerat, purus magna viverra ligula, eu tristique justo purus sit amet ligula. Etiam viverra, enim in luctus sollicitudin, arcu nulla accumsan quam, ut mattis orci eros at dui.&lt;/p&gt;

    &lt;p style=&quot;text-align:right;color: #cc0202;&quot;&gt;&lt;a id=&quot;closeHelp1&quot; style=&quot;color:#cc0202;&quot; href=&quot;#&quot;&gt;Close&lt;/a&gt; &lt;strong&gt;X&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div id=&quot;helpDialog2&quot; title=&quot;Help &gt;&gt; Dialog 2&quot;&gt;
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut aliquam orci eget enim vehicula volutpat. Cras eu tellus quis risus venenatis egestas vitae eget est. Donec nec lorem purus. Duis vitae tortor at lacus placerat rhoncus id sit amet lectus. Suspendisse potenti. Aliquam vitae tortor lorem.&lt;/p&gt;
        &lt;p&gt;Proin ac sem magna. Donec interdum iaculis lacinia. Donec placerat malesuada mi, vitae malesuada sapien tincidunt ut. Mauris a nibh arcu. Etiam a magna a ipsum faucibus sollicitudin. Morbi nisl nunc, porttitor vitae suscipit in, rutrum at augue.&lt;/p&gt;
        &lt;p style=&quot;text-align:right;color:#cc0202;&quot;&gt;&lt;a id=&quot;closeHelp2&quot; style=&quot;color:#cc0202;&quot; href=&quot;#&quot;&gt;Close&lt;/a&gt; &lt;strong&gt;X&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>Not much. Just a little styling for sanity&#8217;s sake and lots of Latin. Take note of the id&#8217;s. They are helpDialog1 and helpDialog2. The number will be needed later.</p>
<p>Like, now&#8230;</p>
<pre class="brush: jscript;">
$('[id^=helpDialog]').dialog({
                autoOpen: false,
                modal: false,
                width: 300,
                resizable: false,
                show: 'blind',
                hide: 'blind'
            });
</pre>
<p>The jQuery sets some options for the dialog boxes, and it does this by identifying the dialog boxes with the common part of the id. The &#8216;^&#8217; means &#8217;starts with&#8217; as in the id starts with helpDialog. </p>
<p>Just like that all the dialogs your heart desires are set and ready to go.</p>
<p>The click function on the help buttons does all the heavy lifting.</p>
<pre class="brush: jscript;">
$('.help').click(function() {
              //strip off prefix of buttin id to get number for dialog
                var helpBtnIdPrefix = 'helpBtn';
                var helpBtnNum = $(this).attr('id').substring((helpBtnIdPrefix.length));

                //offset returns top and left of element
                var helpBtnOffset = $('#helpBtn' + helpBtnNum).offset();
                //width of element
                var helpBtnWidth = $('#helpBtn' + helpBtnNum).width();
                //width of dialog box
                var dialogWidth = $('#helpDialog' + helpBtnNum).dialog('option', 'width');

                //x and y positions of dialog box
                $('#helpDialog' + helpBtnNum).dialog('option','position',[helpBtnOffset.left+helpBtnWidth-dialogWidth,helpBtnOffset.top-$(window).scrollTop()]);
                $('#helpDialog' + helpBtnNum).dialog('open');
            });
</pre>
<p>The script starts by stripping off the prefix on the button id to get to the number of the button as it corresponds to the dialog box. </p>
<p>Then it gets the button offset or left and top position on the document. Next, it gets the button&#8217;s width. All this is used to properly place the dialog over the button.</p>
<p>The x position of the dialog are set using the button&#8217;s left position and width along with the dialog box width. The y position is set by using the button&#8217;s top position minus the window scroll position in case the user scrolled down.</p>
<p>After the math, the dialog is opened.</p>
<p>An extra close button was added at the bottom of the dialog box for user convenience.</p>
<pre class="brush: jscript;">
//added close btn at bottom of dialog
            $('[id^=closeHelp]').click(function() {
                var closeHelpPrefix = 'closeHelp';
                var closeHelpNum = $(this).attr('id').substring((closeHelpPrefix.length));
                $('#helpDialog' + closeHelpNum).dialog('close');
            });
</pre>
<p id="demo"><a href="/demos/dialog/position.php"><span>Demo</span></a></p>
<p id="download"><a href="/media/code/dialogposition.zip"><span>Download zip of all files</span></a></p>
<p>Usual recommended jQuery reading:</p>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0596159773" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847196705" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0321647491" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847195121" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/11/12/positioning-multiple-jquery-ui-dialogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passed the Google Analytics Individual Qualification Test</title>
		<link>http://www.jensbits.com/2009/11/06/passed-the-google-analytics-individual-qualification-test/</link>
		<comments>http://www.jensbits.com/2009/11/06/passed-the-google-analytics-individual-qualification-test/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 20:39:31 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=464</guid>
		<description><![CDATA[I took and passed the Google Analytics Individual Qualification test today. It wasn&#8217;t too bad but it did require studying unless you dead set on cheating. I studied all the presentations on Google&#8217;s Conversion University, running through the more difficult stuff twice (AdWords, e-commerce). 
It costs $50 to take. Seems a little steep but I [...]]]></description>
			<content:encoded><![CDATA[<p>I took and passed the Google Analytics Individual Qualification test today. It wasn&#8217;t too bad but it did require studying unless you dead set on cheating. I studied all the presentations on <a href="http://www.google.com/support/conversionuniversity/">Google&#8217;s Conversion University</a>, running through the more difficult stuff twice (AdWords, e-commerce). </p>
<p>It costs $50 to take. Seems a little steep but I did learn so much more than I would have had I not been so motivated. Meaning: I wasn&#8217;t going to waste my $50.</p>
<p><img src="/images/gaCert.gif" alt="I passed!" style="border: 1px solid" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/11/06/passed-the-google-analytics-individual-qualification-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printing a Dynamically Loaded Iframe with jQuery</title>
		<link>http://www.jensbits.com/2009/11/03/printing-a-dynamically-loaded-iframe-with-jquery/</link>
		<comments>http://www.jensbits.com/2009/11/03/printing-a-dynamically-loaded-iframe-with-jquery/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:46:26 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=452</guid>
		<description><![CDATA[This is an example of printing a dynamically loaded iframe on a button click. This is useful for printing specific or generated reports or pages without leaving the current page.
The iframe to be targeted looks like this and can be placed virtually anywhere in the body tag:

&#60;iframe id=&#34;iframeprint&#34; width=&#34;1&#34; height=&#34;1&#34; frameborder=&#34;0&#34;&#62;&#60;/iframe&#62;

The button to be clicked [...]]]></description>
			<content:encoded><![CDATA[<p>This is an example of printing a dynamically loaded iframe on a button click. This is useful for printing specific or generated reports or pages without leaving the current page.</p>
<p>The iframe to be targeted looks like this and can be placed virtually anywhere in the body tag:</p>
<pre class="brush: xml;">
&lt;iframe id=&quot;iframeprint&quot; width=&quot;1&quot; height=&quot;1&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
</pre>
<p>The button to be clicked for printing:</p>
<pre class="brush: xml;">
&lt;p style=&quot;text-align:center&quot;&gt;&lt;a id=&quot;iframeprintbutton&quot; href=&quot;#&quot;&gt;Load and print page in iframe&lt;/a&gt;&lt;/p&gt;
</pre>
<p>The jQuery on the calling page:</p>
<pre class="brush: jscript;">
$().ready(function() {

	$('#iframeprintbutton').click(function() {
		$(&quot;#iframeprint&quot;).attr(&quot;src&quot;, &quot;iframecontents.htm&quot;);
		return false;
     });

});
</pre>
<p>In the example, that page to be printed is in the same directory of the calling page. Use whatever URL will work for the location of the page you want to print. You can use absolute URLs. For example, http://yoursite.com/yourfile.htm.</p>
<p>All that is needed on the page to be printed is a call to the print function.</p>
<pre class="brush: jscript;">
&lt;script type=&quot;application/javascript&quot; language=&quot;javascript&quot;&gt;
$().ready(function() {
	print();
});
&lt;/script&gt;
</pre>
<p>You could probably use straight javascript here, but I find jQuery quicker and easier to work with.</p>
<p id="demo"><a href="/demos/iframeprint/index.htm"><span>Demo</span></a></p>
<p id="download"><a href="/media/code/iframeprint.zip"><span>Download zip of all files</span></a></p>
<p>Usual recommended jQuery reading:</p>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0596159773" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847196705" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0321647491" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847195121" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/11/03/printing-a-dynamically-loaded-iframe-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion cfgrid Selected Row Disappearing / Blank in IE</title>
		<link>http://www.jensbits.com/2009/10/28/coldfusion-cfgrid-selected-row-disappearing-blank-in-ie/</link>
		<comments>http://www.jensbits.com/2009/10/28/coldfusion-cfgrid-selected-row-disappearing-blank-in-ie/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 13:45:06 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=449</guid>
		<description><![CDATA[After selecting a row in cfgrid in Internet Explorer, the selected row goes blank or all white. The data is still there and the row is selected, you just can&#8217;t tell.
The problem lies in a css file that ColdFusion uses for the cfgrid. According to some other posts on the web, there is some incorrectly [...]]]></description>
			<content:encoded><![CDATA[<p>After selecting a row in cfgrid in Internet Explorer, the selected row goes blank or all white. The data is still there and the row is selected, you just can&#8217;t tell.</p>
<p>The problem lies in a css file that ColdFusion uses for the cfgrid. According to <a href="http://blog.seguetech.com/?p=149">some other posts on the web</a>, there is some incorrectly commented out css rules. They are commented out with &#8216;//&#8217; rather than &#8216;/*&#8230;*/&#8217;. The file is ext-all.css and on my set up with IIS, I found it at C:\Inetpub\wwwroot\CFIDE\scripts\ajax\resources\ext\css\ext-all.css.</p>
<p>When the comments are correctly marked up, it got better (the text showed up) but the background color did not behave even though I specified the select background color in the cfgrid attributes with selectColor=&#8221;#FF3300&#8243;. BTW, the selectColor worked for FireFox, IE didn&#8217;t seem to care.</p>
<p>My solution (although imperfect) was to edit the ext-all.css by properly commenting out the bad comments and adding my own background color for the selected td. It&#8217;s imperfect because it overrides the selectColor in FireFox.</p>
<pre class="brush: css;">
.x-grid-row-selected td, .x-grid-locked .x-grid-row-selected td{
	background-color: #316ac5; /* added */
	/*color: white;*/
}

.x-grid-row-selected span, .x-grid-row-selected b, .x-grid-row-selected div, .x-grid-row-selected strong, .x-grid-row-selected i{
	color:white !important;
}

.x-grid-row-selected .x-grid-cell-text{
	/*color: white;*/
}

.x-grid-cell-selected{
	/*color: white;*/
}

.x-grid-cell-selected span{
	/*color: white !important;*/
}

.x-grid-cell-selected .x-grid-cell-text{
	/*color: white;*/
}
</pre>
<p>Hope this helps someone else and I hope Adobe fixes it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/10/28/coldfusion-cfgrid-selected-row-disappearing-blank-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.ajax and jQuery.post Form Submit Examples with ColdFusion</title>
		<link>http://www.jensbits.com/2009/10/23/jquery-ajax-and-jquery-post-form-submit-examples-with-coldfusion/</link>
		<comments>http://www.jensbits.com/2009/10/23/jquery-ajax-and-jquery-post-form-submit-examples-with-coldfusion/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 13:17:30 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=441</guid>
		<description><![CDATA[This is the same as the previous jquery form submit post that used PHP just flavored with CF this time.
Two jQuery functions that allow for the submission of form are the jQuery.ajax function and the jQuery.post function (there is also jQuery.get but that is not addressed here). 
More functionality, along with more complexity, is offered [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>This is the same as the previous <a href="/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/">jquery form submit post that used PHP</a> just flavored with CF this time.</p></blockquote>
<p>Two jQuery functions that allow for the submission of form are the jQuery.ajax function and the jQuery.post function (there is also jQuery.get but that is not addressed here). </p>
<p>More functionality, along with more complexity, is offered with the .ajax function while the .post function, with its more simple functionality and implementation, will be all that is needed for simple form posts.</p>
<blockquote><p>It is <strong>highly recommended</strong> that you get a tool like <a href="http://getfirebug.com/">Firebug</a> to see the post response coming back from the page. It helps immensely.</p></blockquote>
<p>Here is an example of both in action doing the same thing: form submit with email validation.</p>
<h2>jQuery.ajax</h2>
<p> The form:</p>
<pre class="brush: xml;">
&lt;form id=&quot;JqAjaxForm&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;jQuery.ajax Form Submit&lt;/legend&gt;
&lt;p&gt;&lt;label for=&quot;name_ajax&quot;&gt;Name:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;name_ajax&quot; type=&quot;text&quot; name=&quot;name_ajax&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;label for=&quot;email_ajax&quot;&gt;E-mail:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;email_ajax&quot; type=&quot;text&quot; name=&quot;email_ajax&quot;  /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/p&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
&lt;div id=&quot;message_ajax&quot;&gt;&lt;/div&gt;
</pre>
<p>Pretty simple, nothing fancy. There is a form for each jQuery function, .ajax and .post. The only difference in the forms are the element names.</p>
<p>jQuery controls the submit for the forms. For the .ajax submission the jQuery is this:</p>
<pre class="brush: jscript;">
$(function(){
    $(&quot;#JqAjaxForm&quot;).submit(function(){
        dataString = $(&quot;#JqAjaxForm&quot;).serialize();

        $.ajax({
        type: &quot;POST&quot;,
        url: &quot;process_form.cfm&quot;,
        data: dataString,
        dataType: &quot;json&quot;,
        success: function(data) {

            if(data.email_check == &quot;invalid&quot;){
                $(&quot;#message_ajax&quot;).html(&quot;&lt;div class='errorMessage'&gt;Sorry &quot; + data.name + &quot;, &quot; + data.email + &quot; is NOT a valid e-mail address. Try again.&lt;/div&gt;&quot;);
            } else {
                $(&quot;#message_ajax&quot;).html(&quot;&lt;div class='successMessage'&gt;&quot; + data.email + &quot; is a valid e-mail address. Thank you, &quot; + data.name + &quot;.&lt;/div&gt;&quot;);
            }

        }

        });

        return false;            

    });
});
</pre>
<p>The .serialize function is used to put the form data in a format that can be processed by a page on the server. The .ajax function options include:</p>
<ul>
<li>type: &#8220;get&#8221; or &#8220;post&#8221;</li>
<li>url: the page to receive the form data</li>
<li>data: the form data itself</li>
<li>dataType: the data type the function should expect back from the server</li>
<li>success function: runs on a succesful post to the page</li>
</ul>
<p>More information on the options and further explanations of the options used here can be found on the<a href="http://docs.jquery.com/Ajax/jQuery.ajax"> jQuery.ajax documentation page</a>.</p>
<h2>jQuery.post</h2>
<p>As in the .ajax example, the form is simple, only the names have been changed:</p>
<pre class="brush: xml;">
&lt;form id=&quot;JqPostForm&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;jQuery.post Form Submit&lt;/legend&gt;
&lt;p&gt;&lt;label for=&quot;name_post&quot;&gt;Name:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;name_post&quot; type=&quot;text&quot; name=&quot;name_post&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;label for=&quot;email_post&quot;&gt;E-mail:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;email_post&quot; type=&quot;text&quot; name=&quot;email_post&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/p&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
&lt;div id=&quot;message_post&quot;&gt;&lt;/div&gt;
</pre>
<p>And again, jQuery controls the submit for the forms. For the .post submission the jQuery is this:</p>
<pre class="brush: jscript;">
$(function(){
    $(&quot;#JqPostForm&quot;).submit(function(){
        $.post(&quot;process_form.cfm&quot;, $(&quot;#JqPostForm&quot;).serialize(),
        function(data){
            if(data.email_check == 'invalid'){

                    $(&quot;#message_post&quot;).html(&quot;&lt;div class='errorMessage'&gt;Sorry &quot; + data.name + &quot;, &quot; + data.email + &quot; is NOT a valid e-mail address. Try again.&lt;/div&gt;&quot;);
            } else {
                $(&quot;#message_post&quot;).html(&quot;&lt;div class='successMessage'&gt;&quot; + data.email + &quot; is a valid e-mail address. Thank you, &quot; + data.name + &quot;.&lt;/div&gt;&quot;);
                }
        }, &quot;json&quot;);

        return false;

    });
});
</pre>
<p>jQuery.post is a shorter, easier way to post the form data. The function arguments are:</p>
<ul>
<li>url of the form processing page</li>
<li>the form data</li>
<li>the callback function
<li>
<li>the data type of the return data</li>
</ul>
<p>More information can be found on the<a href="http://docs.jquery.com/Ajax/jQuery.post"> jQuery.post documentation page</a>.</p>
<h2>Processing the Form</h2>
<p>Both methods are processed by the same page. It processes the form data, process_form.cfm in this example, by checking to see if the e-mail submitted is valid. Much more than that could be done on the page if needed.</p>
<pre class="brush: coldfusion;">
&lt;cfset email_check = &quot;&quot; /&gt;
&lt;cfset return_json_string = &quot;&quot; /&gt;
&lt;cfset return_struct = StructNew() /&gt;

&lt;cfif (isDefined(&quot;form.email_ajax&quot;) AND isValid(&quot;email&quot;,form.email_ajax)) OR (isDefined(&quot;form.email_post&quot;) AND isValid(&quot;email&quot;,form.email_post))&gt;
   &lt;cfset email_check = &quot;valid&quot;/&gt;
&lt;cfelse&gt;
    &lt;cfset email_check = &quot;invalid&quot;/&gt;
&lt;/cfif&gt;

&lt;cfset StructInsert(return_struct, &quot;email_check&quot;, email_check) /&gt;

&lt;cfif isDefined(&quot;form.email_ajax&quot;)&gt;
	&lt;cfset StructInsert(return_struct, &quot;name&quot;, form.name_ajax) /&gt;
	&lt;cfset StructInsert(return_struct, &quot;email&quot;, form.email_ajax) /&gt;

	&lt;!---return_json_string is for pre-CF 8 only, delete if you have cf 8 or later---&gt;
	&lt;cfset return_json_string = '{&quot;email_check&quot;:&quot;#email_check#&quot;,&quot;name&quot;:&quot;' &amp; form.name_ajax &amp; '&quot;,&quot;email&quot;:&quot;' &amp; form.email_ajax &amp; '&quot;}' /&gt;

&lt;cfelse&gt;
	&lt;cfset StructInsert(return_struct, &quot;name&quot;, form.name_post) /&gt;
	&lt;cfset StructInsert(return_struct, &quot;email&quot;, form.email_post) /&gt;

	&lt;!---return_json_string is for pre-CF 8 only, delete if you have cf 8 or later---&gt;
	&lt;cfset return_json_string = '{&quot;email_check&quot;:&quot;#email_check#&quot;,&quot;name&quot;:&quot;' &amp; form.name_post &amp; '&quot;,&quot;email&quot;:&quot;' &amp; form.email_post &amp; '&quot;}' /&gt;

&lt;/cfif&gt;

&lt;!--- serializeJSON is CF 8 and above only, see below for pre-CF 8 ---&gt;
&lt;cfoutput&gt;#serializeJSON(return_struct)#&lt;/cfoutput&gt;

&lt;!--- Uncomment the cfoutput statement below and remove the cfoutput statement above if you don't have CF 8---&gt;
&lt;!--- &lt;cfoutput&gt;#return_json_string#&lt;/cfoutput&gt; ---&gt;
</pre>
<p>This code puts the results of the e-mail validation and the form data in a <a href="http://json.org/">JSON-formatted</a> string. It then will output the return data string which is picked up by the success function in the .ajax function or the function(data) function in the .post function on the original page. </p>
<p>I prefer working with JSON, but there are other options for the return data. Check the jQuery documentation for the types available to you.</p>
<p>The JSON response will look like this:</p>
<pre class="brush: jscript;">
{&quot;email_check&quot;:&quot;valid&quot;,&quot;name&quot;:&quot;Julia&quot;,&quot;email&quot;:&quot;julia@example.com&quot;}
</pre>
<p><span style="color: red;font-weight: bold;">NOTE: If you have ColdFusion 8 or better use the <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_s_03.html">serializeJSON function</a>. This function can return query results, arrays, dates, strings, and the like to JSON which is easily consumed and digested by javascript. Pre-CF 8 will require building the JSON string manually but with some loops and other creativity, it can be done.</span></p>
<p>The appropriate message based on the e-mail validation check is then displayed.</p>
<p>Pretty simple, pretty handy couple of jQuery functions. Once you see it in action, you get the idea.</p>
<p id="download"><a href="/media/code/jQAjaxPostCF.zip"><span>Download zip of all files</span></a></p>
<p>Usual recommended jQuery and CF reading:</p>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0596159773" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0321647491" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847195121" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=032151548X" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/10/23/jquery-ajax-and-jquery-post-form-submit-examples-with-coldfusion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery.ajax and jQuery.post Form Submit Examples with PHP</title>
		<link>http://www.jensbits.com/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/</link>
		<comments>http://www.jensbits.com/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 00:11:55 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=425</guid>
		<description><![CDATA[For a version of this using ColdFusion, see the CF jquery form submit post.
Two jQuery functions that allow for the submission of form are the jQuery.ajax function and the jQuery.post function (there is also jQuery.get but that is not addressed here). 
More functionality, along with more complexity, is offered with the .ajax function while the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>For a version of this using ColdFusion, see the <a href="/2009/10/23/jquery-ajax-and-jquery-post-form-submit-examples-with-coldfusion/">CF jquery form submit post</a>.</p></blockquote>
<p>Two jQuery functions that allow for the submission of form are the jQuery.ajax function and the jQuery.post function (there is also jQuery.get but that is not addressed here). </p>
<p>More functionality, along with more complexity, is offered with the .ajax function while the .post function, with its more simple functionality and implementation, will be all that is needed for simple form posts.</p>
<blockquote><p>It is <strong>highly recommended</strong> that you get a tool like <a href="http://getfirebug.com/">Firebug</a> to see the post response coming back from the page. It helps immensely.</p></blockquote>
<p>Here is an example of both in action doing the same thing: form submit with email validation.</p>
<h2>jQuery.ajax</h2>
<p> The form:</p>
<pre class="brush: xml;">
&lt;form id=&quot;JqAjaxForm&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;jQuery.ajax Form Submit&lt;/legend&gt;
&lt;p&gt;&lt;label for=&quot;name_ajax&quot;&gt;Name:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;name_ajax&quot; type=&quot;text&quot; name=&quot;name_ajax&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;label for=&quot;email_ajax&quot;&gt;E-mail:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;email_ajax&quot; type=&quot;text&quot; name=&quot;email_ajax&quot;  /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/p&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
&lt;div id=&quot;message_ajax&quot;&gt;&lt;/div&gt;
</pre>
<p>Pretty simple, nothing fancy. There is a form for each jQuery function, .ajax and .post. The only difference in the forms are the element names.</p>
<p>jQuery controls the submit for the forms. For the .ajax submission the jQuery is this:</p>
<pre class="brush: jscript;">
$(function(){
    $(&quot;#JqAjaxForm&quot;).submit(function(){
        dataString = $(&quot;#JqAjaxForm&quot;).serialize();

        $.ajax({
        type: &quot;POST&quot;,
        url: &quot;process_form.php&quot;,
        data: dataString,
        dataType: &quot;json&quot;,
        success: function(data) {

            if(data.email_check == &quot;invalid&quot;){
                $(&quot;#message_ajax&quot;).html(&quot;&lt;div class='errorMessage'&gt;Sorry &quot; + data.name + &quot;, &quot; + data.email + &quot; is NOT a valid e-mail address. Try again.&lt;/div&gt;&quot;);
            } else {
                $(&quot;#message_ajax&quot;).html(&quot;&lt;div class='successMessage'&gt;&quot; + data.email + &quot; is a valid e-mail address. Thank you, &quot; + data.name + &quot;.&lt;/div&gt;&quot;);
            }

        }

        });

        return false;            

    });
});
</pre>
<p>The .serialize function is used to put the form data in a format that can be processed by a page on the server. The .ajax function options include:</p>
<ul>
<li>type: &#8220;get&#8221; or &#8220;post&#8221;</li>
<li>url: the page to receive the form data</li>
<li>data: the form data itself</li>
<li>dataType: the data type the function should expect back from the server</li>
<li>success function: runs on a succesful post to the page</li>
</ul>
<p>More information on the options and further explanations of the options used here can be found on the<a href="http://docs.jquery.com/Ajax/jQuery.ajax"> jQuery.ajax documentation page</a>.</p>
<h2>jQuery.post</h2>
<p>As in the .ajax example, the form is simple, only the names have been changed:</p>
<pre class="brush: xml;">
&lt;form id=&quot;JqPostForm&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;jQuery.post Form Submit&lt;/legend&gt;
&lt;p&gt;&lt;label for=&quot;name_post&quot;&gt;Name:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;name_post&quot; type=&quot;text&quot; name=&quot;name_post&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;label for=&quot;email_post&quot;&gt;E-mail:&lt;/label&gt;&lt;br /&gt;
&lt;input id=&quot;email_post&quot; type=&quot;text&quot; name=&quot;email_post&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/p&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
&lt;div id=&quot;message_post&quot;&gt;&lt;/div&gt;
</pre>
<p>And again, jQuery controls the submit for the forms. For the .post submission the jQuery is this:</p>
<pre class="brush: jscript;">
$(function(){
    $(&quot;#JqPostForm&quot;).submit(function(){
        $.post(&quot;process_form.php&quot;, $(&quot;#JqPostForm&quot;).serialize(),
        function(data){
            if(data.email_check == 'invalid'){

                    $(&quot;#message_post&quot;).html(&quot;&lt;div class='errorMessage'&gt;Sorry &quot; + data.name + &quot;, &quot; + data.email + &quot; is NOT a valid e-mail address. Try again.&lt;/div&gt;&quot;);
            } else {
                $(&quot;#message_post&quot;).html(&quot;&lt;div class='successMessage'&gt;&quot; + data.email + &quot; is a valid e-mail address. Thank you, &quot; + data.name + &quot;.&lt;/div&gt;&quot;);
                }
        }, &quot;json&quot;);

        return false;

    });
});
</pre>
<p>jQuery.post is a shorter, easier way to post the form data. The function arguments are:</p>
<ul>
<li>url of the form processing page</li>
<li>the form data</li>
<li>the callback function
<li>
<li>the data type of the return data</li>
</ul>
<p>More information can be found on the<a href="http://docs.jquery.com/Ajax/jQuery.post"> jQuery.post documentation page</a>.</p>
<h2>Processing the Form</h2>
<p>Both methods are processed by the same page. It processes the form data, process_form.php in this example, by checking to see if the e-mail submitted is valid. Much more than that could be done on the page if needed.</p>
<pre class="brush: php;">
$email_check = '';
$return_json = '';

function isValidEmail($email){
    return eregi(&quot;^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$&quot;, $email);
}

if(isValidEmail($_POST['email_ajax']) || isValidEmail($_POST['email_post'])) {
   $email_check = 'valid';
}
else {
    $email_check = 'invalid';
}

$return_json = '{&quot;email_check&quot;:&quot;' . $email_check . '&quot;,';

if (isset($_POST['email_ajax'])){
    $return_json = $return_json . '&quot;name&quot;:&quot;' . $_POST['name_ajax'] . '&quot;,';
    $return_json = $return_json . '&quot;email&quot;:&quot;' . $_POST['email_ajax'] . '&quot;}';
} else {
    $return_json = $return_json . '&quot;name&quot;:&quot;' . $_POST['name_post'] . '&quot;,';
    $return_json = $return_json . '&quot;email&quot;:&quot;' . $_POST['email_post'] . '&quot;}';
}

echo $return_json;
</pre>
<p>This code puts the results of the e-mail validation and the form data in a <a href="http://json.org/">JSON-formatted</a> string. It then will echo the return data string which is picked up by the success function in the .ajax function or the function(data) function in the .post function on the original page. </p>
<p>I prefer working with JSON, but there are other options for the return data. Check the jQuery documentation for the types available to you.</p>
<p>The JSON response will look like this:</p>
<pre class="brush: jscript;">
{&quot;email_check&quot;:&quot;valid&quot;,&quot;name&quot;:&quot;Julia&quot;,&quot;email&quot;:&quot;julia@example.com&quot;}
</pre>
<p><span style="color: red;font-weight: bold;">NOTE: If you have PHP 5.2 or better and the <a href="http://us3.php.net/filter_var">filter_var</a> and <a href="http://us3.php.net/json_encode">json_encode</a> functions available, use the following code instead:</span></p>
<pre class="brush: php;">
$email_check = '';
$return_arr = array();

if(filter_var($_POST['email_ajax'], FILTER_VALIDATE_EMAIL) || filter_var($_POST['email_post'], FILTER_VALIDATE_EMAIL)) {
   $email_check = 'valid';
}
else {
    $email_check = 'invalid';
}

$return_arr[&quot;email_check&quot;] = $email_check;

if (isset($_POST['email_ajax'])){
    $return_arr[&quot;name&quot;] = $_POST['name_ajax'];
    $return_arr[&quot;email&quot;] = $_POST['email_ajax'];
} else {
    $return_arr[&quot;name&quot;] = $_POST['name_post'];
    $return_arr[&quot;email&quot;] = $_POST['email_post'];

}

echo json_encode($return_arr);
</pre>
<p>The appropriate message based on the e-mail validation check is then displayed.</p>
<p>Pretty simple, pretty handy couple of jQuery functions. Once you see it in action, you get the idea.</p>
<p id="demo"><a href="/demos/jqsubmit/index.php"><span>Demo</span></a></p>
<p id="download"><a href="/media/code/jQAjaxPostPHP.zip"><span>Download zip of all files</span></a></p>
<p>Usual recommended jQuery and PHP reading:</p>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847196705" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0321647491" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1847195121" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<div style="float:left;margin-right: 25px">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=jensbits-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0764557467" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Override “Print Background Colors and Images” Option in Browser</title>
		<link>http://www.jensbits.com/2009/09/18/override-printing-of-background-images-and-colors/</link>
		<comments>http://www.jensbits.com/2009/09/18/override-printing-of-background-images-and-colors/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:39:36 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=422</guid>
		<description><![CDATA[Internet Explorer and Firefox, to name a few, have an option that allows for the printing of background colors and images. The user can check this option to override the print style sheet and print the backgrounds that were removed to increase legibility, protect copyright, or whatever other reason was necessary. 
By default, this option [...]]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer and Firefox, to name a few, have an option that allows for the printing of background colors and images. The user can check this option to override the print style sheet and print the backgrounds that were removed to increase legibility, protect copyright, or whatever other reason was necessary. </p>
<p>By default, this option is off in browsers and the user has to manually check a box. In IE it is under Tools, Internet Options, Advanced, Printing. In Firefox it is in Page Setup of the Print Preview window.</p>
<p>Here is what is looks like in FF:<br />
<img src="/images/ff_printsettings.gif" alt="Firefox print settings" /><br />
To prevent the browser from printing backgrounds when this is checked, add the following to your print style sheet:</p>
<pre class="brush: css;">
* {
  background-color: white !important;
  background-image: none !important;
  }
</pre>
<p>Now, I&#8217;m not one to take all control away from the user, but there are situations when you must.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/09/18/override-printing-of-background-images-and-colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion Example: Session Timeout Warning with jQuery/JS</title>
		<link>http://www.jensbits.com/2009/09/12/session-timeout-warning-with-coldfusion-and-jqueryjs/</link>
		<comments>http://www.jensbits.com/2009/09/12/session-timeout-warning-with-coldfusion-and-jqueryjs/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 18:57:58 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=412</guid>
		<description><![CDATA[I wrote a post on session timeout warnings with PHP; here&#8217;s a version with ColdFusion. Some of the text is the same because the method and principles are the same for both languages.
Javascript is needed to keep track of the time the user has been sitting on the page. The server does not know how [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a <a href="/2009/09/07/session-timeout-warning-php-example-with-jqueryjs/">post on session timeout warnings with PHP</a>; here&#8217;s a version with ColdFusion. Some of the text is the same because the method and principles are the same for both languages.</p>
<p>Javascript is needed to keep track of the time the user has been sitting on the page. The server does not know how long they have been sitting there. It only knows whether or not a request comes in during a session or after the session has expired and acts accordingly at that time. Too late for a warning.</p>
<h3>Session Defined: Start to Finish</h3>
<p>A session is defined as when a user begins and ends using or visiting a web site. It can be unlimited in length or strictly defined by a timeout period. If the site requires a log in or accesses sensitive data, it should time out after a period of inactivity. They can end a session by logging out or closing the browser.</p>
<p>Inactivity means the user has done nothing, made no requests of the web server, during a specified time. Ajax requests usually do not count. </p>
<h3>Demo</h3>
<p>The session time left is determined by the server, and, if you want to poll the server with an Ajax request, go for it. Javascript is used to keep track of the time left in the session.</p>
<p>The demo uses a simple log in with session timing handled by jquery and javascript. When the session expiration approaches, the user is warned and given an opportunity to restart the session. If the session time limit is reached, the user is prompted to log in again. If they ignore that prompt, the page automatically redirects to the log in form. In the demo this sequence of events takes 40 seconds to complete and is broken down as follows:</p>
<ol>
<li><em>Session timeout:</em> 30 seconds</li>
<li><strong>Timeout warning:</strong> 20 seconds</li>
<li><strong>Session expired warning:</strong> 10 seconds</li>
<li><strong>Redirect to log in page: </strong>10 seconds</li>
</ol>
<h3>Interrupting the User</h3>
<p>The user&#8217;s attention can be diverted away from other open windows to the eminent session expiration by using a javascript alert in place of the jquery dialog box. Personal preference.</p>
<h3>Code Breakdown</h3>
<p>The application.cfc controls the session by creating non-persistent cookies for CFID and CFTOKEN so the session expires when the user&#8217;s browser closes. It also sets the session variables requestStartTime, timeoutLength, and sessionStartTime. The sessionStartTime variable is used to illustrate the fact that the application.cfc function OnSessionStart only fires once. It does not fire every time a session is renewed or restarted.</p>
<pre class="brush: coldfusion;">
&lt;cfcomponent
    displayname=&quot;Application&quot;
    output=&quot;false&quot;
    hint=&quot;Handle the application.&quot;&gt;

    &lt;!--- Set up the application. ---&gt;
    &lt;cfset THIS.Name = &quot;sessiontest&quot; /&gt;
    &lt;cfset THIS.ApplicationTimeout = CreateTimeSpan(0,1,0,0) /&gt;
    &lt;!--- CreateTimeSpan(days, hours, minutes, seconds) ---&gt;
    &lt;cfset THIS.SessionTimeout = CreateTimeSpan(0,0,0,30) /&gt;
    &lt;cfset THIS.SessionManagement = true /&gt;
    &lt;cfset THIS.SetClientCookies = false /&gt;

    &lt;cffunction
        name=&quot;OnSessionStart&quot;
        access=&quot;public&quot;
        returntype=&quot;void&quot;
        output=&quot;false&quot;
        hint=&quot;Fires ONLY ONCE when session first created and not when session renewed/restarted.&quot;&gt;       

        &lt;!---set cfid/cftoken as non-persistent cookies so session ends on browser close ---&gt;
        &lt;cfif not IsDefined(&quot;Cookie.CFID&quot;)&gt;
            &lt;cflock scope=&quot;session&quot; type=&quot;readonly&quot; timeout=&quot;5&quot;&gt;
                &lt;cfcookie name=&quot;CFID&quot; value=&quot;#session.CFID#&quot;&gt;
                &lt;cfcookie name=&quot;CFTOKEN&quot; value=&quot;#session.CFTOKEN#&quot;&gt;
                 &lt;cfset session.SessionStartTime = Now() /&gt;
            &lt;/cflock&gt;
        &lt;/cfif&gt;

        &lt;cfreturn /&gt;
    &lt;/cffunction&gt;

    &lt;cffunction
        name=&quot;OnRequestStart&quot;
        access=&quot;public&quot;
        returntype=&quot;boolean&quot;
        output=&quot;true&quot;
        hint=&quot;Fires at first part of page processing.&quot;&gt;

        &lt;!--- Define arguments. ---&gt;
        &lt;cfargument
            name=&quot;TargetPage&quot;
            type=&quot;string&quot;
            required=&quot;true&quot;
            /&gt;

        &lt;cfset session.RequestStartTime = Now() /&gt;
        &lt;!---number of seconds until session times out---&gt;
        &lt;cfset session.timeoutLength = 30 /&gt;

        &lt;cfreturn true /&gt;
    &lt;/cffunction&gt;    

&lt;/cfcomponent&gt;
</pre>
<p>The log in page checks for a query string variable called &#8216;expired&#8217; and, if present, deletes the session loggedin variable. This is there because the code is going to control the expiration of the session eliminating the need to compensate for browser latency. The actual session start time the time the page loads can differ by several seconds. To avoid having to add time to the session or any other fancy guesswork, when the allotted session time has expired according to the javascript timer on the page, they are done &#8211; session over.</p>
<p>If they are logged in, they get bumped to the index page. The rest is the logic that handles the log in form.</p>
<p>Note: I would not recommend handling a log in form this way. This is for demonstration only.</p>
<pre class="brush: coldfusion;">
&lt;cfif isDefined(&quot;url.expired&quot;) AND url.expired&gt;
    &lt;cfset StructDelete(session,&quot;loggedin&quot;) /&gt;
&lt;/cfif&gt;

&lt;cfif isDefined(&quot;form.username&quot;) AND isDefined(&quot;form.pw&quot;) AND form.username EQ &quot;session&quot; AND form.pw EQ &quot;test&quot;&gt;
    &lt;cfset session.loggedin = true /&gt;
&lt;/cfif&gt;

&lt;cfif StructKeyExists(session, &quot;loggedin&quot;) AND session.loggedin&gt;
    &lt;cflocation url=&quot;index.cfm&quot; addToken=&quot;no&quot; /&gt;
&lt;/cfif&gt;
</pre>
<p>Other than the log in form and a message for the user, that&#8217;s all there is to the log in page.</p>
<h3>Handling Session Timeout</h3>
<p>The index page handles the session timeout code. This could be a separate javascript included in every page. The first block simply determines if they are logged in. If they are not, send them to the login page. If they are, load the index page.</p>
<pre class="brush: coldfusion;">
&lt;!---if not logged in, send them to login page, else load the index page---&gt;
&lt;cfif NOT StructKeyExists(session, &quot;loggedin&quot;) OR NOT session.loggedin&gt;
    &lt;cflocation url=&quot;login.cfm&quot; addToken=&quot;no&quot; /&gt;
&lt;cfelse&gt;
 &lt;!---Load the page ---&gt;
&lt;/cfif&gt;
</pre>
<p>Now the time variables are set and the a javascript timer is set to check the session every 10 seconds.<br />
Javascript uses milliseconds so for clarity the time intervals multiply the number of seconds by 1,000. You could put 10000 in for 10 seconds but I think 10*1000 helps me determine that it is 10 seconds quite a bit faster. Do what is comfortable for you.</p>
<pre class="brush: jscript;">
//event to check session time variable declaration
var checkSessionTimeEvent = 0;

$(document).ready(function() {
	//event to check session time left (times 1000 to convert seconds to milliseconds)
    checkSessionTimeEvent = setInterval(&quot;checkSessionTime()&quot;,10*1000);
});

&lt;cfoutput&gt;
//time session started
#toScript(session.requeststarttime,&quot;requestTime&quot;)#

//session timeout length
var timeoutLength = #session.timeoutLength#*1000;
&lt;/cfoutput&gt;

//force redirect to log in page length (session timeout plus 10 seconds)
var forceRedirectLength = timeoutLength + (10*1000);

//set time for first warning, ten seconds before session expires
var warningTime = timeoutLength - (10*1000);

//set number of seconds to count down from for countdown ticker
var countdownTime = 10;
</pre>
<p>The ColdFusion toScript() function is used to create a javascript variable from a CF variable. Very handy.<br />
The checkSessionTime function is what gets fired off every 10 seconds by the timer. It does a time comparison and opens the dialog boxes that warn the user.</p>
<pre class="brush: jscript;">
function checkSessionTime()
{
	//get time now
	var timeNow = new Date(); 

	//event create countdown ticker variable declaration
	var countdownTickerEvent; 	

	//difference between time now and time session started variable declartion
	var timeDifference = 0;

	timeDifference = timeNow - requestTime;

    if (timeDifference &gt; warningTime &amp;&amp; timeDifference &lt; timeoutLength)
        {
            //call now for initial dialog box text (time left until session timeout)
            countdownTicker(); 

            //set as interval event to countdown seconds to session timeout
            countdownTickerEvent = setInterval(&quot;countdownTicker()&quot;, 1000);

            $('#dialogWarning').dialog('open');
        }
    else if (timeDifference &gt; timeoutLength)
    	{
    		//close warning dialog box
            if ($('#dialogWarning').dialog('isOpen')) $('#dialogWarning').dialog('close');

            $('#dialogExpired').dialog('open');

            //clear (stop) countdown ticker
            clearInterval(countdownTickerEvent);
        }

     if (timeDifference &gt; forceRedirectLength)
     	{
        	//clear (stop) checksession event
            clearInterval(checkSessionTimeEvent);

            //force relocation
            window.location=&quot;login.cfm?expired=true&quot;;
        }
}
</pre>
<p>The countdownTicker function provides a countdown inside the warning dialog box to prompt the user to act now. It uses a timer that fires every second for a 5,4,3,2,1 effect inside the dialog box.</p>
<pre class="brush: jscript;">
function countdownTicker()
{
	//put countdown time left in dialog box
	$(&quot;span#dialogText-warning&quot;).html(countdownTime);

	//decrement countdownTime
	countdownTime--;
}
</pre>
<p>And, the dialog boxes either allow the user to reload the page or, if they did nothing when the warning popped up, it logs them out by redirecting to the log in page with the expired variable in the query string. Also, thanks to scube&#8217;s debugging, it now redirects to the log in if they hit the close button on the dialog box rather than the Login button.</p>
<pre class="brush: jscript;">
$(function(){
                // jQuery UI Dialog
                $('#dialogWarning').dialog({
                    autoOpen: false,
                    width: 400,
                    modal: true,
                    resizable: false,
		    close: function() {
                            window.location=&quot;login.php?expired=true&quot;;
                     },
                    buttons: {
                        &quot;Restart Session&quot;: function() {
                            location.reload();
                        }
                    }
                });

                $('#dialogExpired').dialog({
                    autoOpen: false,
                    width: 400,
                    modal: true,
                    resizable: false,
                    buttons: {
                        &quot;Login&quot;: function() {
                            window.location=&quot;login.cfm?expired=true&quot;;
                        }
                    }
                });
});
</pre>
<p>The dialog box contents are at the bottom of the page but they could be just about anywhere in the body.</p>
<pre class="brush: xml;">
&lt;!--Dialog box contents--&gt;
&lt;div id=&quot;dialogExpired&quot; title=&quot;Session (Page) Expired!&quot;&gt;&lt;p&gt;&lt;span class=&quot;ui-icon ui-icon-alert&quot; style=&quot;float:left; margin:0 7px 0 0;&quot;&gt;&lt;/span&gt; Your session has expired!&lt;p id=&quot;dialogText-expired&quot;&gt;&lt;/p&gt;&lt;/div&gt;

&lt;div id=&quot;dialogWarning&quot; title=&quot;Session (Page) Expiring!&quot;&gt;&lt;p&gt;&lt;span class=&quot;ui-icon ui-icon-alert&quot; style=&quot;float:left; margin:0 7px 0 0;&quot;&gt;&lt;/span&gt; Your session will expire in &lt;span id=&quot;dialogText-warning&quot;&gt;&lt;/span&gt; seconds!&lt;/div&gt;
</pre>
<p>Remember, this is just one example. There are other ways to do this. Use this, improve this, or roll your own.</p>
<p id="download"><a href="/media/code/session-expire-cf.zip?keycode=down123&#038;sourcecode=down789&#038;cost=200&#038;utm_source=website&#038;utm_medium=cpc&#038;utm_content=dl%2Blink&#038;utm_campaign=Download%2BLink"><span>Download zip of all files</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/09/12/session-timeout-warning-with-coldfusion-and-jqueryjs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Session Timeout Warning PHP Example with jQuery/JS</title>
		<link>http://www.jensbits.com/2009/09/07/session-timeout-warning-php-example-with-jqueryjs/</link>
		<comments>http://www.jensbits.com/2009/09/07/session-timeout-warning-php-example-with-jqueryjs/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 00:45:37 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[browser]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=386</guid>
		<description><![CDATA[Detecting and warning a user of their session timing out can come in handy and, in some cases, may be necessary. Here is one way of doing this with jQuery/javascript and PHP. There may be a better way to do this, so take this as an example.
There is a post on a ColdFusion session timeout [...]]]></description>
			<content:encoded><![CDATA[<p>Detecting and warning a user of their session timing out can come in handy and, in some cases, may be necessary. Here is one way of doing this with jQuery/javascript and PHP. There may be a better way to do this, so take this as an example.<br />
There is a post on a <a href="/2009/09/12/session-timeout-warning-with-coldfusion-and-jqueryjs/">ColdFusion session timeout warning</a> that works in a similar manner.</p>
<h3>Session Defined: Start to Finish</h3>
<p>A session is defined as when a user begins and ends using or visiting a web site. It can be unlimited in length or strictly defined by a timeout period. If the site requires a log in or accesses sensitive data, it should time out after a period of inactivity. They can end a session by logging out or closing the browser.</p>
<p>Inactivity means the user has done nothing, made no requests of the web server, during a specified time. Ajax requests usually do not count. There are other posts out there that detail how to check for session expiration with Ajax requests.</p>
<h3>Demo</h3>
<p>The session time left is determined by the server, and, if you want to poll the server with an Ajax request, go for it. This demo uses javascript to keep track of the time left in the session.</p>
<p>The demo uses a simple log in with session timing handled by jquery and javascript. When the session expiration approaches, the user is warned and given an opportunity to restart the session. If the session time limit is reached, the user is prompted to log in again. If they ignore that prompt, the page automatically redirects to the log in form. In the demo this sequence of events takes 40 seconds to complete and is broken down as follows:</p>
<ol>
<li><em>Session timeout:</em> 30 seconds</li>
<li><strong>Timeout warning:</strong> 20 seconds</li>
<li><strong>Session expired warning:</strong> 10 seconds</li>
<li><strong>Redirect to log in page: </strong>10 seconds</li>
</ol>
<h3>Interrupting the User</h3>
<p>The user&#8217;s attention can be diverted away from other open windows to the eminent session expiration by using a javascript alert in place of the jquery dialog box. Personal preference.</p>
<h3>Code Breakdown</h3>
<p>The log in page checks for a query string variable called &#8216;expired&#8217; and sets the loggedin cookie to false. This is there because the code is going to control the expiration of the session eliminating the need to compensate for browser latency. The actual session start time the time the page loads can differ by several seconds. To avoid having to add time to the session or any other fancy guesswork, when the allotted session time has expired according to the javascript timer on the page, they are done &#8211; session over.</p>
<p>If they are logged in, they get bumped to the index page. The rest is the logic that handles the log in form.</p>
<p>Note: I would not recommend handling a log in form this way. This is for demonstration only.</p>
<pre class="brush: php;">
//if query string contains expired var &amp; it = true, set loggedin cookie as false
//else if loggedin cookie exists and is set to true, send to index page
if (isset($_GET['expired']) &amp;&amp; $_GET['expired'] == 'true')
    {
        setcookie(&quot;loggedin&quot;, &quot;false&quot;, time()+30);
    }
elseif (isset($_COOKIE['loggedin']) &amp;&amp; $_COOKIE['loggedin'] == 'true')
    {
        header(&quot;Location: index.php&quot;);
        exit;
    }
//log in logic
if (isset($_POST['username']) &amp;&amp; isset($_POST['pw']) &amp;&amp; $_POST['username'] == &quot;session&quot; &amp;&amp; $_POST['pw'] == &quot;test&quot;)
    {
        setcookie(&quot;loggedin&quot;, &quot;true&quot;, time()+30);
        header(&quot;Location: index.php&quot;);
        exit;
    }
</pre>
<p>Other than the log in form and a message for the user, that&#8217;s all there is to the log in page.</p>
<h3>Handling Session Timeout</h3>
<p>The index page handles the session timeout code. This could be a separate javascript included in every page. The first block simply determines if they are logged in. If they are not, send them to the login page. If they are, refresh the cookie timeout by resetting it.</p>
<pre class="brush: php;">
if (!isset($_COOKIE['loggedin']) || (isset($_COOKIE['loggedin']) &amp;&amp; $_COOKIE['loggedin'] == 'false'))
    {
        header(&quot;Location: login.php&quot;);
        exit;
    }
elseif (isset($_COOKIE['loggedin']) &amp;&amp; $_COOKIE['loggedin'] == 'true')
    {
    //user is logged in, page was refreshed or reloaded to restart session so reset cookie
    setcookie(&quot;loggedin&quot;, &quot;true&quot;, time()+30);
    }
?&gt;
</pre>
<p>Now the time variables are set and the a javascript timer is set to check the session every 10 seconds.<br />
Javascript uses milliseconds so for clarity the time intervals multiply the number of seconds by 1,000. You could put 10000 in for 10 seconds but I think 10*1000 helps me determine that it is 10 seconds quite a bit faster. Do what is comfortable for you.</p>
<pre class="brush: jscript;">
//event to check session time variable declaration
var checkSessionTimeEvent;

$(document).ready(function() {
	//event to check session time left (times 1000 to convert seconds to milliseconds)
    checkSessionTimeEvent = setInterval(&quot;checkSessionTime()&quot;,10*1000);
});

//time session started
var pageRequestTime = new Date();

//session timeout length
var timeoutLength = 30*1000;

//force redirect to log in page length (session timeout plus 10 seconds)
var forceRedirectLength = timeoutLength + (10*1000);

//set time for first warning, ten seconds before session expires
var warningTime = timeoutLength - (10*1000);

//set number of seconds to count down from for countdown ticker
var countdownTime = 10;
</pre>
<p>The checkSessionTime function is what gets fired off every 10 seconds by the timer. It does a time comparison and opens the dialog boxes that warn the user.</p>
<pre class="brush: jscript;">
function checkSessionTime()
{
	//get time now
	var timeNow = new Date(); 

	//event create countdown ticker variable declaration
	var countdownTickerEvent; 	

	//difference between time now and time session started variable declartion
	var timeDifference = 0;

	timeDifference = timeNow - pageRequestTime;

    if (timeDifference &gt; warningTime &amp;&amp; timeDifference &lt; timeoutLength)
        {
            //call now for initial dialog box text (time left until session timeout)
            countdownTicker(); 

            //set as interval event to countdown seconds to session timeout
            countdownTickerEvent = setInterval(&quot;countdownTicker()&quot;, 1000);

            $('#dialogWarning').dialog('open');
        }
    else if (timeDifference &gt; timeoutLength){
    		//close warning dialog box
            if ($('#dialogWarning').dialog('isOpen')) $('#dialogWarning').dialog('close');

            $('#dialogExpired').dialog('open');

             //clear (stop) countdown ticker
            clearInterval(countdownTickerEvent);
        }

    if (timeDifference &gt; forceRedirectLength)
     	{
           //clear (stop) checksession event
            clearInterval(checkSessionTimeEvent);

            //force relocation
            window.location=&quot;login.php?expired=true&quot;;
        }
}
</pre>
<p>The countdownTicker function provides a countdown inside the warning dialog box to prompt the user to act now. It uses a timer that fires every second for a 5,4,3,2,1 effect inside the dialog box.</p>
<pre class="brush: jscript;">
function countdownTicker()
{
	//put countdown time left in dialog box
	$(&quot;span#dialogText-warning&quot;).html(countdownTime);

	//decrement countdownTime
	countdownTime--;
}
</pre>
<p>And, the dialog boxes either allow the user to reload the page or, if they did nothing when the warning popped up, it logs them out by redirecting to the log in page with the expired variable in the query string. Also, thanks to scube&#8217;s debugging, it now redirects to the log in if they hit the close button on the dialog box rather than the Login button.</p>
<pre class="brush: jscript;">
$(function(){
                // jQuery UI Dialog
                $('#dialogWarning').dialog({
                    autoOpen: false,
                    width: 400,
                    modal: true,
                    resizable: false,
                    buttons: {
                        &quot;Restart Session&quot;: function() {
                            location.reload();
                        }
                    }
                });

                $('#dialogExpired').dialog({
                    autoOpen: false,
                    width: 400,
                    modal: true,
                    resizable: false,
                    close: function() {
                            window.location=&quot;login.php?expired=true&quot;;
                        },
                    buttons: {
                        &quot;Login&quot;: function() {
                            window.location=&quot;login.php?expired=true&quot;;
                        }
                    }
                });
});
</pre>
<p>The dialog box contents are at the bottom of the page but they could be just about anywhere in the body.</p>
<pre class="brush: xml;">
&lt;!--Dialog box contents--&gt;
&lt;div id=&quot;dialogExpired&quot; title=&quot;Session (Page) Expired!&quot;&gt;&lt;p&gt;&lt;span class=&quot;ui-icon ui-icon-alert&quot; style=&quot;float:left; margin:0 7px 0 0;&quot;&gt;&lt;/span&gt; Your session has expired!&lt;p id=&quot;dialogText-expired&quot;&gt;&lt;/p&gt;&lt;/div&gt;

&lt;div id=&quot;dialogWarning&quot; title=&quot;Session (Page) Expiring!&quot;&gt;&lt;p&gt;&lt;span class=&quot;ui-icon ui-icon-alert&quot; style=&quot;float:left; margin:0 7px 0 0;&quot;&gt;&lt;/span&gt; Your session will expire in &lt;span id=&quot;dialogText-warning&quot;&gt;&lt;/span&gt; seconds!&lt;/div&gt;
</pre>
<p>Remember, this is just one example. There are other ways to do this. Use this, improve this, or roll your own.</p>
<p id="demo"><a href="/demos/session/php/index.php"><span>Demo</span></a></p>
<p id="download"><a href="/media/code/session-expire-php.zip"><span>Download zip of all files</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/09/07/session-timeout-warning-php-example-with-jqueryjs/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>[Discussion] Donating to Developers: It’s the Right Thing to Do</title>
		<link>http://www.jensbits.com/2009/09/03/discussion-donating-to-developers-its-the-right-thing-to-do/</link>
		<comments>http://www.jensbits.com/2009/09/03/discussion-donating-to-developers-its-the-right-thing-to-do/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 12:57:41 +0000</pubDate>
		<dc:creator>jen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[discussion]]></category>

		<guid isPermaLink="false">http://www.jensbits.com/?p=381</guid>
		<description><![CDATA[I just went through the WordPress plugins I use and donated to every developer that had a donation link. 
I know, and you know, how much work and time goes into creating plugins and tutorials for fellow developers and newbies. The least any of us can do is throw a dime or two at these [...]]]></description>
			<content:encoded><![CDATA[<p>I just went through the WordPress plugins I use and donated to every developer that had a donation link. </p>
<p>I know, and you know, how much work and time goes into creating plugins and tutorials for fellow developers and newbies. The least any of us can do is throw a dime or two at these folks.</p>
<p>And, for heaven&#8217;s sake, if <strong>your getting paid for using someone else&#8217;s work</strong>, send them something. Anything. $5, $10, whatever. </p>
<p>Let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jensbits.com/2009/09/03/discussion-donating-to-developers-its-the-right-thing-to-do/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
