<?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>Marius&#039; Blog &#187; AJAX</title>
	<atom:link href="http://mariuscristiandonea.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariuscristiandonea.com</link>
	<description>A collection of code samples I use for my work ... and my work.</description>
	<lastBuildDate>Sat, 02 Jul 2011 09:35:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Front End AJAX in WordPress</title>
		<link>http://mariuscristiandonea.com/2011/06/29/front-end-ajax-in-wordpress/</link>
		<comments>http://mariuscristiandonea.com/2011/06/29/front-end-ajax-in-wordpress/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 08:14:36 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mariuscristiandonea.com/?p=451</guid>
		<description><![CDATA[This code will help you use AJAX in WordPress Front End.]]></description>
			<content:encoded><![CDATA[<p>Copy the below code in a file (frontend-ajax.php) and call it as an AJAX url.</p>
<p><strong>PHP code:</strong></p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><a href="http://www.php.net/define"><span class="kw3">define</span></a><span class="br0">&#40;</span><span class="st0">&quot;DOING_AJAX&quot;</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="kw1">require_once</span><span class="br0">&#40;</span><span class="st0">&quot;../../../wp-load.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Add wp-load.php file.</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st0">&quot;action&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">||</span> <a href="http://www.php.net/trim"><span class="kw3">trim</span></a><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st0">&quot;action&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">==</span><span class="st0">&quot;&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="st0">&quot;-1&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
<span class="sy0">@</span><a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">&quot;Content-Type: text/html; charset=&quot;</span><span class="sy0">.</span>get_option<span class="br0">&#40;</span><span class="st0">&quot;blog_charset&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw1">include_once</span><span class="br0">&#40;</span><span class="st0">&quot;filePath&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Including your plugin&#8217;s main file where ajax actions are defined.</span><br />
send_nosniff_header<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
<span class="kw1">if</span><span class="br0">&#40;</span>has_action<span class="br0">&#40;</span><span class="st0">&quot;wp_ajax_&quot;</span><span class="sy0">.</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st0">&quot;action&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; do_action<span class="br0">&#40;</span><span class="st0">&quot;wp_ajax_&quot;</span><span class="sy0">.</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st0">&quot;action&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p>status_header<span class="br0">&#40;</span>404<span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mariuscristiandonea.com/2011/06/29/front-end-ajax-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thumbnail Gallery (WordPress Plugin)</title>
		<link>http://mariuscristiandonea.com/2011/06/17/thumbnail-gallery-wordpress-plugin/</link>
		<comments>http://mariuscristiandonea.com/2011/06/17/thumbnail-gallery-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 07:05:54 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress Plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mariuscristiandonea.com/?p=442</guid>
		<description><![CDATA[Description: This Plugin will help you to easily add a thumbnail gallery to your WordPress website or blog. The gallery is completely customizable, resizable and is compatible with all browsers and devices (iPhone, iPad and Android smartphones). You will be able to insert it in any page or post you want with inbuilt short code [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codecanyon.net/item/thumbnail-gallery-wordpress-plugin/294024?ref=MariusCristianDonea" target="_blank"><img class="post-image" title="Thumbnail Gallery (WordPress Plugin)" src="http://mariuscristiandonea.com/wp-content/uploads/2011/06/thumbnail-gallery-wordpress.png" alt="Thumbnail Gallery (WordPress Plugin)" width="460" height="345" /></a></p>
<p><strong>Description:</strong> This Plugin will help you to easily add a thumbnail gallery to your WordPress website or blog. The gallery is completely customizable, resizable and is compatible with all browsers and devices (iPhone, iPad and Android smartphones). You will be able to insert it in any page or post you want with inbuilt<br />
short code generator.<br />
<strong>Download &amp; Preview:</strong> <a title="CodeCanyon" href="http://codecanyon.net/item/thumbnail-gallery-wordpress-plugin/294024?ref=MariusCristianDonea" target="_blank">CodeCanyon</a><br />
<strong>Technologies: </strong>AJAX, CSS, HTML, JavaScript, jQuery, PHP, WordPress</p>
]]></content:encoded>
			<wfw:commentRss>http://mariuscristiandonea.com/2011/06/17/thumbnail-gallery-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wall/Grid Gallery (WordPress Plugin)</title>
		<link>http://mariuscristiandonea.com/2011/06/14/wallgrid-gallery-wordpress-plugin/</link>
		<comments>http://mariuscristiandonea.com/2011/06/14/wallgrid-gallery-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 10:04:11 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress Plugin]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mariuscristiandonea.com/?p=438</guid>
		<description><![CDATA[Description: This Plugin will help you to easily add a grid gallery to your WordPress website or blog. The gallery is completely customizable, resizable and is compatible with all browsers and devices (iPhone, iPad and Android smartphones). You will be able to insert it in any page or post you want with inbuilt short code [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codecanyon.net/item/wallgrid-gallery-wordpress-plugin/270895?ref=MariusCristianDonea" target="_blank"><img class="post-image" title="Wall/Grid Gallery (WordPress Plugin)" src="http://mariuscristiandonea.com/wp-content/uploads/2011/06/wall-grid-gallery-wordpress.png" alt="Wall/Grid Gallery (WordPress Plugin)" width="460" height="345" /></a></p>
<p><strong>Description:</strong> This Plugin will help you to easily add a grid gallery to your WordPress website or blog. The gallery is completely customizable, resizable and is compatible with all browsers and devices (iPhone, iPad and Android smartphones). You will be able to insert it in any page or post you want with inbuilt short code generator.<br />
<strong>Download &amp; Preview:</strong> <a title="CodeCanyon" href="http://codecanyon.net/item/wallgrid-gallery-wordpress-plugin/270895?ref=MariusCristianDonea" target="_blank">CodeCanyon</a><br />
<strong>Technologies: </strong>AJAX, CSS, HTML, JavaScript, jQuery, PHP, WordPress</p>
]]></content:encoded>
			<wfw:commentRss>http://mariuscristiandonea.com/2011/06/14/wallgrid-gallery-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX Booking Calendar Pro (jQuery Plugin)</title>
		<link>http://mariuscristiandonea.com/2011/05/30/ajax-booking-calendar-pro-jquery-plugin/</link>
		<comments>http://mariuscristiandonea.com/2011/05/30/ajax-booking-calendar-pro-jquery-plugin/#comments</comments>
		<pubDate>Mon, 30 May 2011 08:20:57 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript jQuery]]></category>

		<guid isPermaLink="false">http://mariuscristiandonea.com/?p=435</guid>
		<description><![CDATA[Description: This item is ideal if you want to add information about bookings to your rentals website. The Back End is easy to use and can be easily integrated into your own CMS as the Front End can be easily integrated into your website. Both Back End and Front End can be customized separately, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codecanyon.net/item/ajax-booking-calendar-pro-jquery-plugin/244645?ref=MariusCristianDonea"><img class="post-image" title="AJAX Booking Calendar Pro" src="http://mariuscristiandonea.com/wp-content/uploads/2011/05/booking-calendar-jquery.png" alt="" width="460" height="345" /></a></p>
<p><strong>Description:</strong> This item is ideal if you want to add information about bookings to your rentals website. The Back End is easy to use and can be easily integrated into your own CMS as the Front End can be easily integrated into your website. Both Back End and Front End can be customized separately, and the number of usages on your webpage or website is unlimited.<br />
The Calendar comes with a PHP script, but any server side script can be used to load or to save data from any database. The Booking Calendar is compatible with all browsers and devices (iPhone, iPad and Android smartphones).<br />
<strong>Download &amp; Preview:</strong> <a title="CodeCanyon" href="http://codecanyon.net/item/ajax-booking-calendar-pro-jquery-plugin/244645?ref=MariusCristianDonea" target="_blank">CodeCanyon</a><br />
<strong>Technologies: </strong>AJAX, CSS, HTML, JavaScript, jQuery</p>
]]></content:encoded>
			<wfw:commentRss>http://mariuscristiandonea.com/2011/05/30/ajax-booking-calendar-pro-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Karisma Sportwear</title>
		<link>http://mariuscristiandonea.com/2011/01/29/karisma-sportwear/</link>
		<comments>http://mariuscristiandonea.com/2011/01/29/karisma-sportwear/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 15:54:21 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript jQuery]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://mariuscristiandonea.com/?p=371</guid>
		<description><![CDATA[Karisma Sportwear store.]]></description>
			<content:encoded><![CDATA[<p>[nggallery id=5 template=slideshow]</p>
<p><strong>Description:</strong> Karisma Sportwear store.<br />
<strong>Website:</strong> <a title="Karisma Sportwear" href="http://www.karismasport.com/" target="_blank">http://www.karismasport.com/</a><br />
<strong>Design:</strong> <a title="2Mediax" href="http://www.2mediax.com/" target="_blank">2Mediax</a><br />
<strong>Developed for:</strong> <a title="Vuzum" href="http://www.vuzum.com/" target="_blank">Vuzum</a><br />
<strong>Technologies: </strong>AJAX, CSS, HTML, JavaScript, jQuery, PHP</p>
]]></content:encoded>
			<wfw:commentRss>http://mariuscristiandonea.com/2011/01/29/karisma-sportwear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX form request using POST method</title>
		<link>http://mariuscristiandonea.com/2009/08/05/ajax-form-request-using-post-method/</link>
		<comments>http://mariuscristiandonea.com/2009/08/05/ajax-form-request-using-post-method/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 08:33:34 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript jQuery]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://mariuscristiandonea.com/?p=151</guid>
		<description><![CDATA[Here is a way you can call a server side script with AJAX, using POST method.]]></description>
			<content:encoded><![CDATA[<p>Here is a way you can call a server side script with AJAX, using POST method.</p>
<p><strong>JavaScript code:</strong></p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="kw2">var</span> xmlHttpVariable<span class="sy0">;</span> <span class="co1">// Declare a global variable.</span></p>
<p><span class="co1">// HTTP request object.</span><br />
<span class="kw2">function</span> GetXmlHttpObject<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> xmlHttp <span class="sy0">=</span> <span class="kw2">null</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">try</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; xmlHttp <span class="sy0">=</span> <span class="kw2">new</span> XMLHttpRequest<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">catch</span> <span class="br0">&#40;</span>e<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">try</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlHttp <span class="sy0">=</span> <span class="kw2">new</span> ActiveXObject<span class="br0">&#40;</span><span class="st0">&quot;Msxml2.XMLHTTP&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">catch</span> <span class="br0">&#40;</span>e<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlHttp <span class="sy0">=</span> <span class="kw2">new</span> ActiveXObject<span class="br0">&#40;</span><span class="st0">&quot;Microsoft.XMLHTTP&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">return</span> xmlHttp<span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> callServer<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; xmlHttpVariable <span class="sy0">=</span> <span class="kw2">new</span> GetXmlHttpObject<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Call HTTP request object.</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> url <span class="sy0">=</span> <span class="st0">&quot;url&quot;</span><span class="sy0">;</span> <span class="co1">// Set the URL to the server-side script.</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> variables <span class="sy0">=</span> <span class="st0">&quot;var1=val1&amp;amp;var2=val2&quot;</span><span class="sy0">;</span> <span class="co1">// Set the variables.</span><br />
&nbsp; &nbsp; xmlHttpVariable.<span class="me1">onreadystatechange</span> <span class="sy0">=</span> stateChangedVariable<span class="sy0">;</span> <span class="co1">// Call a function on state change.</span><br />
&nbsp; &nbsp; xmlHttpVariable.<span class="kw3">open</span><span class="br0">&#40;</span><span class="st0">&quot;POST&quot;</span><span class="sy0">,</span>url<span class="sy0">,</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Open the URL.</span><br />
&nbsp; &nbsp; <span class="co1">// Send the proper header information along with the request.</span><br />
&nbsp; &nbsp; xmlHttpVariable.<span class="me1">setRequestHeader</span><span class="br0">&#40;</span><span class="st0">&quot;Content-type&quot;</span><span class="sy0">,</span> <span class="st0">&quot;application/x-www-form-urlencoded&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; xmlHttpVariable.<span class="me1">setRequestHeader</span><span class="br0">&#40;</span><span class="st0">&quot;Content-length&quot;</span><span class="sy0">,</span> variables.<span class="me1">length</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; xmlHttpVariable.<span class="me1">setRequestHeader</span><span class="br0">&#40;</span><span class="st0">&quot;Connection&quot;</span><span class="sy0">,</span> <span class="st0">&quot;close&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; xmlHttpVariable.<span class="me1">send</span><span class="br0">&#40;</span>variables<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Send the variables.</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> stateChangedVariable<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>xmlHttpVariable.<span class="me1">readyState</span> <span class="sy0">==</span> <span class="nu0">4</span><span class="br0">&#41;</span><span class="br0">&#123;</span><span class="co1">// Values for readyState see below for explanations.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>xmlHttpVariable.<span class="me1">responseText</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/^\s+|\s+$/g</span><span class="sy0">,</span> <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;return value&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Action here.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>readyState values:</strong></p>
<p>0 &#8211; Represents an &#8220;uninitialized&#8221; state in which an XMLHttt pRequesobject has been created, but not initialized.</p>
<p>1 &#8211; Represents a &#8220;sent&#8221; state in which code has called the XMLHttpRequest open() method and the XMLHttpRequest is ready to send a request to the server.</p>
<p>2 &#8211; Represents a &#8220;sent&#8221; state in which a request has been sent to the server with the send() method, but a response has not yet been received.</p>
<p>3 &#8211; Represents a &#8220;receiving&#8221; state in which the HTTP response headers have been received, but message body has not yet been completely received.</p>
<p>4 &#8211; Represents a &#8220;loaded&#8221; state in which the response has been completely received.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariuscristiandonea.com/2009/08/05/ajax-form-request-using-post-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

