<?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>Bright Cherry &#187; Ajax</title>
	<atom:link href="http://www.brightcherry.co.uk/scribbles/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightcherry.co.uk/scribbles</link>
	<description></description>
	<lastBuildDate>Fri, 27 Aug 2010 18:00:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Ajax JQuery &#8211; Rotating Image Script</title>
		<link>http://www.brightcherry.co.uk/scribbles/2010/08/27/ajax-jquery-rotating-image-script/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2010/08/27/ajax-jquery-rotating-image-script/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 18:00:38 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=241</guid>
		<description><![CDATA[I can&#8217;t remember for the life of me where I got this code from, but if I could, I&#8217;d give the author the credit. I didn&#8217;t write this code, but it&#8217;s something I wanted to share because it&#8217;s pretty cool. There are HUNDREDS of image rotating scripts out there, but I like this one in [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t remember for the life of me where I got this code from, but if I could, I&#8217;d give the author the credit. I didn&#8217;t write this code, but it&#8217;s something I wanted to share because it&#8217;s pretty cool.</p>
<p>There are HUNDREDS of image rotating scripts out there, but I like this one in particular because the code is light and it&#8217;s a lot smoother than a lot I&#8217;ve seen. Additionally, unlike a lot of the examples out there, this method doesn&#8217;t require a heavy jQuery extension. This is pure JQuery (and a tiny bit of CSS).</p>
<h4>Here&#8217;s an example of what this code will do:</h4>
<p><iframe src ="http://www.brightcherry.co.uk/code_examples/jquery-image-rotate/index.html" width="300" height="300" frameborder="0" scrolling="no"></p>
<p>Your browser does not support iframes.</p>
<p></iframe></p>
<h4>Here&#8217;s the code:</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p241code2'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2412"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code" id="p241code2"><pre class="html" style="font-family:monospace;">/*** set the width and height to match your images **/
&nbsp;
#slideshow {
	position:relative;
	height:330px;
}
&nbsp;
#slideshow img {
	position:absolute;
	top:0;
	left:0;
	z-index:8;
	opacity:0.0;
}
&nbsp;
#slideshow img.active {
	z-index:10;
	opacity:1.0;
}
&nbsp;
#slideshow img.last-active {
	z-index:9;
}
&nbsp;
&lt;script src=&quot;http://code.jquery.com/jquery-latest.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt; 
function slideSwitch() {
var $active = $('#slideshow .active');
if ( $active.length == 0 ) $active = $('#slideshow img:last');
	var $next =  $active.next().length ? $active.next()
	: $('#slideshow img:first');
&nbsp;
	$active.addClass('last-active');
&nbsp;
	$next.css({opacity: 0.0})
		.addClass('active')
    //adjust value to change the time taken to fade between images
		.animate({opacity: 1.0}, 3000, function() {
		$active.removeClass('active last-active');
	});
}
&nbsp;
$(function() {
    //adjust value to change the interval between each image change
		setInterval( &quot;slideSwitch()&quot;, 4000 );
});
&lt;/script&gt;  
&nbsp;
&lt;div id=&quot;slideshow&quot;&gt;
  &lt;!-- the active class is for the image you want to show on page load --&gt; 
	&lt;img src=&quot;images/rotate/1.jpg&quot; class=&quot;active&quot; alt=&quot;&quot; title=&quot;&quot; /&gt; 
	&lt;img src=&quot;images/rotate/2.jpg&quot; alt=&quot;&quot; title=&quot;&quot; /&gt; 
	&lt;img src=&quot;images/rotate/3.jpg&quot; alt=&quot;&quot; title=&quot;&quot; /&gt; 
&lt;/div&gt;</pre></td></tr></table></div>

<h4>Download</h4>
<p><a href="http://www.brightcherry.co.uk/downloads/jquery-image-rotate.zip" rel="nofollow" target="new" title="Download JQuery Rotating Image Script">Download JQuery Rotating Image Script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2010/08/27/ajax-jquery-rotating-image-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax &#8211; Rotating Text</title>
		<link>http://www.brightcherry.co.uk/scribbles/2010/03/29/ajax-rotating-text/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2010/03/29/ajax-rotating-text/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 19:51:50 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=219</guid>
		<description><![CDATA[I just implemented a new feature on Property Investment for the Landlord, which shows a box rotating through various text blocks. Just for clarification, this code doesn&#8217;t just apply to rotating &#8220;text&#8221;, you can put images or anything you want in there. This is just a flat image example: I used the excellent Jquery Innerfade [...]]]></description>
			<content:encoded><![CDATA[<p>I just implemented a new feature on <a href="http://www.propertyinvestmentproject.co.uk/" rel="nofollow"  title="Property Investment">Property Investment</a> for the <a href="http://www.propertyinvestmentproject.co.uk/" rel="nofollow"  title="Landlord">Landlord</a>, which shows a box rotating through various text blocks. Just for clarification, this code doesn&#8217;t just apply to rotating &#8220;text&#8221;, you can put images or anything you want in there.</p>
<p><strong>This is just a flat image example:</strong></p>
<p><img src="http://www.brightcherry.co.uk/images/blogimages/rotate.gif" title="Rotating Text Image" alt="Rotating Text Image" /></p>
<p>I used the excellent <a href="http://medienfreunde.com/lab/innerfade/" rel="nofollow" target="new" title="Jquery Innerfade Plugin">Jquery Innerfade Plugin</a> to get the smooth transitional affect. The speed of the rotation time can be tweaked, as can the live time for each text block.</p>
<h4>Why I like this method</h4>
<p>Ok, there are actually TONNES of ways you can rotate block elements- I&#8217;ve seen and tested so many different pieces of code. It can actually be done with a few lines of pure Javascript, as opposed to using an entire JQuery extension. However, what I like about the code i&#8217;m using is that it works with fluid/elastic websites. For example, if I run this code on a fluid website, the container of the rotating text reduces as I make the browser window smaller, and the rotation doesn&#8217;t mess up. Moreover, the text continues to align properly.</p>
<p>For a clearer picture of what I mean, go to <a href="http://www.propertyinvestmentproject.co.uk/" rel="nofollow"  title="Property Investment">Property Investment</a> and make your browser window narrower and you will see that the rotating block remains perfectly fluid while it still rotates. A lot of the examples I tried didn&#8217;t seem to be able to handle fluid layouts. The rotating either stopped/acted weird, or it didn&#8217;t act fluid.</p>
<h4>Download</h4>
<p>I&#8217;ve quickly put together a working version which you can <a href="http://www.brightcherry.co.uk/downloads/rotatingTxt.zip" rel="nofollow" title="Download Rotating Text Feature">download here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2010/03/29/ajax-rotating-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax JQuery / PHP &#8211; Refresh Table When Inserting Row Into a MySQL Database</title>
		<link>http://www.brightcherry.co.uk/scribbles/2010/03/09/ajax-jquery-php-refresh-table-when-inserting-row-into-a-mysql-database/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2010/03/09/ajax-jquery-php-refresh-table-when-inserting-row-into-a-mysql-database/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 23:01:15 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=209</guid>
		<description><![CDATA[I&#8217;ve had a few people asking me how to refresh a table (not the entire page) when inserting rows into a MySQL database, so I thought I&#8217;d quickly put together a small demo. Here&#8217;s a basic demo of what I&#8217;m talking about. If you populate the form and press &#8220;Submit&#8221; you&#8217;ll notice the table updates [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a few people asking me how to <b class="pink">refresh a table (not the entire page) when inserting rows into a MySQL database</b>, so I thought I&#8217;d quickly put together a small demo.</p>
<p>Here&#8217;s a basic <a href="http://www.brightcherry.co.uk/code_examples/table_refresh/insert.php"rel="nofollow" target="new"  title="Ajax JQuery / PHP - Refresh Table When Inserting Row Into a MySQL Database Demo">demo</a> of what I&#8217;m talking about. If you populate the form and press &#8220;Submit&#8221; you&#8217;ll notice the table updates without the entire page refreshing.</p>
<p><img src="http://www.brightcherry.co.uk/images/blogimages/ajax_table_refresh.jpg" title="Refresh Table When Inserting Row Into a MySQL Database" alt="Refresh Table When Inserting Row Into a MySQL Database" /></p>
<h4>Demo</h4>
<p><a href="http://www.brightcherry.co.uk/code_examples/table_refresh/insert.php"rel="nofollow" target="new"  title="Ajax JQuery / PHP - Refresh Table When Inserting Row Into a MySQL Database Demo">Ajax JQuery / PHP &#8211; Refresh Table Demo</a>.</p>
<p>I&#8217;ve put a limit of 20 entries on the demo version, to save myself from being abused!!</p>
<h4>Download</h4>
<p><a href="http://brightcherry.co.uk/downloads/ajax_table_refresh_by_brightcherry.zip"rel="nofollow" target="new"  title="Download Ajax JQuery / PHP - Refresh Table">Download Ajax JQuery / PHP &#8211; Refresh Table</a></p>
<p><strong>Please note</strong>, I have merely provided a guide. You are strongly advised to implement your own server and client side error checking.</p>
<p>I hope you find the code useful <img src='http://www.brightcherry.co.uk/scribbles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2010/03/09/ajax-jquery-php-refresh-table-when-inserting-row-into-a-mysql-database/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JQuery- Auto Refresh Div Every X Seconds</title>
		<link>http://www.brightcherry.co.uk/scribbles/2009/02/26/jquery-auto-refresh-div-every-x-seconds/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2009/02/26/jquery-auto-refresh-div-every-x-seconds/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 10:12:40 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=141</guid>
		<description><![CDATA[I&#8217;ve recently been working on a e-commerce site (online store) for a client. One of the features required was to show the most recently viewed items on the homepage. For that to work, I need to write a script to query a DB every 10secs or so. Youtube actually has something similar, where on the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been working on a e-commerce site (online store) for a client. One of the features required was to show the most recently viewed items on the homepage. For that to work, I need to write a script to query a DB every 10secs or so. <a href="http://www.youtube.com/"rel="nofollow" target="new"  title="Youtube">Youtube</a> actually has something similar, where on the homepage they display &#8220;videos that are being viewed now&#8221;. I don&#8217;t know how they do, but this is how I do it&#8230;</p>
<p>Obviously it&#8217;s an AJAX affect; as always, I&#8217;ll be using the <a href="http://jquery.com/" rel="nofollow" target="new">JQuery</a> library (my personal favourite). </p>
<p>Here&#8217;s the <b class="pink">OUTDATED</b> code (find updated code below this example)&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p141code5'); return false;">View Code</a> JS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1415"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p141code5"><pre class="js" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;!-- For ease i'm just using a JQuery version hosted by JQuery- you can download any version and link to it locally --&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
&nbsp;
&lt;script&gt;
var refreshId = setInterval(function()
{
     $('#responsecontainer').fadeOut(&quot;slow&quot;).load('response.php').fadeIn(&quot;slow&quot;);
}, 10000);
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&nbsp;
&lt;div id=&quot;responsecontainer&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;</pre></td></tr></table></div>

<p>As you can see, the JS code in the header is calling a file called response.php. That&#8217;s the file which will refresh every 10 seconds. Just change the value to increase/decrease the refresh period. The #responsecontainer div is where the response.php will be displayed.</p>
<p>It&#8217;s as easy as that.</p>
<p>If anyone uses the code, let me know how you get on <img src='http://www.brightcherry.co.uk/scribbles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>UPDATE- Load content immediately on page load &amp; I.E Fix</h4>
<p>I&#8217;ve had a LOADS of people emailing us asking how to get the content in the data.php file to load immediately on pageload, and then start the refreshing process. Also, a lot of people had issues with this code in I.E. I believe I&#8217;ve managed to deal with both problems. Here&#8217;s the code for that:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p141code6'); return false;">View Code</a> JS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1416"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code" id="p141code6"><pre class="js" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;!-- For ease i'm just using a JQuery version hosted by JQuery- you can download any version and link to it locally --&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
 $(document).ready(function() {
 	 $(&quot;#responsecontainer&quot;).load(&quot;response.php&quot;);
   var refreshId = setInterval(function() {
      $(&quot;#responsecontainer&quot;).load('response.php?randval='+ Math.random());
   }, 9000);
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&nbsp;
&lt;div id=&quot;responsecontainer&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;</pre></td></tr></table></div>

<p>Click <a href="http://www.brightcherry.co.uk/test/refresh.php" rel="nofollow" target="new">here for an example</a> (page should start reloading after 5 secs or so- you&#8217;ll notice the number changing). You can <a href="http://www.brightcherry.co.uk/test/refresh.zip" rel="nofollow" target="new">download the working files here</a>.</p>
<p>I hope that helps! If anyone tries this updated code, please let me know if it works ok. Thanks a lot <img src='http://www.brightcherry.co.uk/scribbles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2009/02/26/jquery-auto-refresh-div-every-x-seconds/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
		<item>
		<title>Ajax Jquery Contact Form With Validation</title>
		<link>http://www.brightcherry.co.uk/scribbles/2008/12/11/ajax-jquery-contact-form-with-validation/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2008/12/11/ajax-jquery-contact-form-with-validation/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 22:02:12 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=124</guid>
		<description><![CDATA[I&#8217;ve put together a simple AJAX contact form, using the Jquery library (my personal favourite). What does this all mean? Well, it&#8217;s basically a contact form which validates and submits an email without the page refreshing. You can see an example on our contact page. The example i&#8217;m providing for download is extremely simple. If [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve put together a simple AJAX contact form, using the <a href="http://jquery.com/" target="_blank" rel="nofollow" title="Jquery">Jquery</a> library (my personal favourite). </p>
<p>What does this all mean? Well, it&#8217;s basically a contact form which validates and submits an email without the page refreshing. You can see an example on our <a href="http://www.brightcherry.co.uk/contact/" rel="nofollow"  title="BrightCherry Contact Form">contact</a> page.</p>
<p>The example i&#8217;m providing for download is extremely simple. If you know HTML/PHP it&#8217;s extremely easy to modify and adjust to your own personal needs.</p>
<h4>Download</h4>
<p><a href="http://www.brightcherry.co.uk/downloads/Ajax_contact form_by_BrightCherry.zip" rel="nofollow"  title="Download Ajax Jquery Contact Form With Validation">Ajax Jquery Contact Form With Validation</a></p>
<h4>Quick Notes</h4>
<ul>
<li>Please checkout the submitemail.php file. In there you need to update certain variables. E.g where you want the email to go, and the subject line</li>
<li>
I advice you not to alter the PHP code unless you actually know PHP
</li>
<li>
If the script generates a &#8220;Warning: mail()&#8221; error, it means your PHP server needs to enable the mail() function. It is not a scripting error.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2008/12/11/ajax-jquery-contact-form-with-validation/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
