<?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>El Blog del Antonio &#187; JQuery</title>
	<atom:link href="http://www.ramirezcobos.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ramirezcobos.com</link>
	<description>Programming Web with PHP, CSS, Javascript and ∞</description>
	<lastBuildDate>Wed, 14 Jul 2010 14:03:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PalmStudios Model Agency</title>
		<link>http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/</link>
		<comments>http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 14:03:03 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Jobs]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=489</guid>
		<description><![CDATA[Hi there, I would like to introduce you my last web project: http://www.palmstudios.com For this project I have developed a sort of MVC (Model View Controller) over the RedBeanPHP DB library (PHP 5.3.2).  This project even though it looks quite simple it has a very power CMS (Content Management System) on its backend that allows]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-490" href="http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-03-00/"><img class="alignright size-medium wp-image-490" title="Captura de pantalla 2010-07-12 a las 16.03.00" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.03.00-300x248.png" alt="" width="300" height="248" /></a>Hi there,</p>
<p>I would like to introduce you my last web project: <a title="Palmstudios Model Agency" href="http://www.palmstudios.com" target="_blank">http://www.palmstudios.com</a></p>
<p>For this project I have developed a sort of MVC (Model View Controller) over the <a title="RedBean PHP" href="http://www.redbeanphp.com" target="_blank">RedBeanPHP</a> DB library (PHP 5.3.2).  This project even though it looks quite simple it has a very power CMS (Content Management System) on its backend that allows the model agency to control most of the aspects of its business:</p>
<ol>
<li>- Clients Management</li>
<li>- Models Management (Men, Women, Children &amp; Extras) -contact details, measurements, pictures, and so on&#8230;</li>
<li>- Promotional Packages Management &#8211; this is a special addon which allows the agency to create model promotional bundles to send to its clients</li>
</ol>
<p>There is a ton of client and server libraries that this application makes use of, such as:</p>
<ul>
<li>JQuery FancyBox</li>
<li>JQuery Livequery</li>
<li>JQuery AjaxQ</li>
<li>PHPMailer</li>
<li>RedBeanPHP</li>
<li>Savant3 Template Engine</li>
<li>PHPThumb</li>
<li>TinyMCE</li>
</ul>
<p>The CMS has a configuration section where site administrator can configure:</p>
<ul>
<li>Web site languages (has multiple language support)</li>
<li>Web site translations (you can even ask GOOGLE about a translation depending of the languages installed on the system)</li>
<li>Model properties (size, height, waist, etc&#8230;)</li>
<li>Hair Colors</li>
<li>Eye Colors</li>
<li>Users</li>
</ul>
<p>Here is a snapshot gallery of the Site and its CMS</p>

<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-03-00/' title='Captura de pantalla 2010-07-12 a las 16.03.00'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.03.00-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.03.00" title="Captura de pantalla 2010-07-12 a las 16.03.00" /></a>
<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-07-44/' title='Captura de pantalla 2010-07-12 a las 16.07.44'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.07.44-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.07.44" title="Captura de pantalla 2010-07-12 a las 16.07.44" /></a>
<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-08-21/' title='Captura de pantalla 2010-07-12 a las 16.08.21'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.08.21-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.08.21" title="Captura de pantalla 2010-07-12 a las 16.08.21" /></a>
<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-09-01/' title='Captura de pantalla 2010-07-12 a las 16.09.01'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.09.01-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.09.01" title="Captura de pantalla 2010-07-12 a las 16.09.01" /></a>
<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-09-27/' title='Captura de pantalla 2010-07-12 a las 16.09.27'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.09.27-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.09.27" title="Captura de pantalla 2010-07-12 a las 16.09.27" /></a>
<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-03-31/' title='Captura de pantalla 2010-07-12 a las 16.03.31'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.03.31-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.03.31" title="Captura de pantalla 2010-07-12 a las 16.03.31" /></a>
<a href='http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/captura-de-pantalla-2010-07-12-a-las-16-03-53/' title='Captura de pantalla 2010-07-12 a las 16.03.53'><img width="120" height="120" src="http://www.ramirezcobos.com/wp-content/uploads/2010/07/Captura-de-pantalla-2010-07-12-a-las-16.03.53-120x120.png" class="attachment-thumbnail" alt="Captura de pantalla 2010-07-12 a las 16.03.53" title="Captura de pantalla 2010-07-12 a las 16.03.53" /></a>

<h2>I am open for Freelance Jobs</h2>
<p>If any of you would like to create a model agency application like this, let me know, I will be more than happy to collaborate with you on it. I will also sell the source code of its panel for any of you who is interested.</p>
<p><center><br />
<script type="text/javascript"><!--
google_ad_client = "pub-7060132287364604";
/* 468x60, creado 16/03/10 */
google_ad_slot = "9029910384";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2010/07/14/palmstudios-model-agency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed Up Your Pages With Lazy Load JQuery Plugin</title>
		<link>http://www.ramirezcobos.com/2010/06/15/speed-up-your-pages-with-lazy-load-jquery-plugin/</link>
		<comments>http://www.ramirezcobos.com/2010/06/15/speed-up-your-pages-with-lazy-load-jquery-plugin/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 15:06:54 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=476</guid>
		<description><![CDATA[I would like to introduce you this simple but very efficient plugin that will help us speed up the downloading time of our web pages. I am talking about mr Mika Tuupola&#8217;s Lazy Load JQuery Plugin. This plugin loads the images of a web page as the user scrolls to their position, that is, images]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-372" href="http://www.ramirezcobos.com/2010/01/14/jquery-1-4-are-you-ready/picture-121-300x157/"><img class="alignright size-full wp-image-372" title="Picture-121-300x157" src="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png" alt="" width="300" height="157" /></a>I would like to introduce you this simple but very efficient plugin that will help us speed up the downloading time of our web pages. I am talking about mr <a href="http://www.appelsiini.net/projects/lazyload/enabled_gazillion.html" target="_blank">Mika Tuupola&#8217;s Lazy Load JQuery Plugin</a>.</p>
<p>This plugin loads the images of a web page as the user scrolls to their position, that is, images wont load until they are not within the visible viewport margins of the window.</p>
<p><strong>How to use</strong></p>
<p>First we need to insert the following references into our code</p>
<pre class="brush: xml;">

&lt;!-- insert a reference to jquery and the jquery.lazyload plugin --&gt;
&lt;script src=&quot;jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.lazyload.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
</pre>
<p>And now this few lines of code in our document.ready function</p>
<pre class="brush: xml;">

&lt;script type=&quot;text/javascript&quot;&gt;
$(function() {
          $(&quot;img&quot;).lazyload({
              placeholder : &quot;img/grey.gif&quot;,
              effect      : &quot;fadeIn&quot;
           });
       });
&lt; /script&gt;
</pre>
<p>And that&#8217;s it! Easy right? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2010/06/15/speed-up-your-pages-with-lazy-load-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Restaurant Casablanca</title>
		<link>http://www.ramirezcobos.com/2010/05/14/restaurant-casablanca/</link>
		<comments>http://www.ramirezcobos.com/2010/05/14/restaurant-casablanca/#comments</comments>
		<pubDate>Fri, 14 May 2010 10:12:57 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=423</guid>
		<description><![CDATA[Another site finished: www.brunocasablanca.com Yeah, is a restaurant business, located in one of the most beautiful places in the Balearic Islands: Betlem, in La Colonia de San Pedro, Majorca, Spain. The site uses a web panel to control: Picture Galleries Web site content Translations Events Suggestions In this site I make use of one of]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/02/Imagen-5.png"></a><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Imagen-5-300x274.png"></a><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/02/Imagen-5-300x274.png"></a><strong><span style="font-weight: normal;"> </span></strong></p>
<div id="attachment_410" class="wp-caption alignright" style="width: 310px"><a rel="attachment wp-att-410" href="http://www.ramirezcobos.com/2010/03/31/torrenova-rentacar/picture-1-5/"><a rel="attachment wp-att-425" href="http://www.ramirezcobos.com/2010/05/14/restaurant-casablanca/screen-shot-2010-05-14-at-11-59-50/"><img class="alignright size-medium wp-image-425" title="Screen shot 2010-05-14 at 11.59.50" src="http://www.ramirezcobos.com/wp-content/uploads/2010/05/Screen-shot-2010-05-14-at-11.59.50-300x214.png" alt="" width="300" height="214" /></a></a><p class="wp-caption-text">Bruno Casablanca Restaurant and Pizzeria</p></div>
<p><em>Another site finished: <a href="http://www.brunocasablanca.com" target="_blank">www.brunocasablanca.com</a></em></p>
<p>Yeah, is a restaurant business, located in one of the most beautiful places in the Balearic Islands: Betlem, in La Colonia de San Pedro, Majorca, Spain. The site uses a web panel to control:</p>
<ul>
<li>Picture Galleries</li>
<li>Web site content</li>
<li>Translations</li>
<li>Events</li>
<li>Suggestions</li>
</ul>
<p>In this site I make use of one of the greatest galleries around <a href="http://www.pirolab.it/pirobox/" target="_blank">Pirobox</a>, <a href="http://blog.philipbrown.id.au/2009/04/boxen-a-jquery-iframe-plugin/" target="_blank">boxen</a> -to display the menu, and <a href="http://page-flip.com/products/" target="_blank">FlippingBook HTML Edition</a> for the menu viewing. You can check the website and see how I implemented these three cool tools, feel free to ask me any doubt related to them in case you wish to use it in any of your sites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2010/05/14/restaurant-casablanca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Lightbox</title>
		<link>http://www.ramirezcobos.com/2010/02/08/visual-lightbox/</link>
		<comments>http://www.ramirezcobos.com/2010/02/08/visual-lightbox/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 15:38:19 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=273</guid>
		<description><![CDATA[This post is for those who wish to implement a beautiful Lightbox plugin on their site or blog and, unfortunately, do not have a clue about Javascript and/or jQuery and/or Html. VisualLightBox is a free application that helps you easily generate online photo albums, lightbox gallery with a nice Lightbox-style overlay effect, in a few]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/02/lightboxXL-thumb.jpg"><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/02/add-images-to-gallery.jpg"><img class="alignright size-medium wp-image-385" title="add-images-to-gallery" src="http://www.ramirezcobos.com/wp-content/uploads/2010/02/add-images-to-gallery-300x210.jpg" alt="" width="300" height="210" /></a></a>This post is for those who wish to implement a beautiful Lightbox plugin on their site or blog and, unfortunately, do not have a clue about Javascript and/or jQuery and/or Html.</p>
<p>VisualLightBox is a free application that helps you easily generate online photo albums, lightbox gallery with a nice Lightbox-style overlay effect, in a few clicks without writing a single line of code.</p>
<p>Just drag&amp;drop your photos to VisualLightBox wizard window, press &#8220;Publish&#8221; and your own css web site album with beautiful LightBox effects will open in the browser instantly!<br />
No css, image editing, javascript, html coding, just a click to get your cool web page album ready.</p>
<p>It takes less than a minute to have your own image gallery.</p>
<p>For full documentation please go to http://lightbox2.com/</p>
<p>Newbies, now there is no excuse to have your featured lightbox on your site!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-7060132287364604";
/* 468x60, creado 16/03/10 */
google_ad_slot = "9029910384";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2010/02/08/visual-lightbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4 -Are you ready?</title>
		<link>http://www.ramirezcobos.com/2010/01/14/jquery-1-4-are-you-ready/</link>
		<comments>http://www.ramirezcobos.com/2010/01/14/jquery-1-4-are-you-ready/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:17:48 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[On The Web]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=241</guid>
		<description><![CDATA[jQuery lovers, today, 14th of January, the programmers of jQuery celebrate its anniversary releasing a new version of this wonderful library. Better iFrame support, great new shorthands, I don&#8217;t know what to say fellows but I am eager to find out what its new features are capable of. The jQuery programmers not happy with a]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ramirezcobos.com/wp-content/uploads/2009/12/Picture-121.png"><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png"><img class="alignright size-full wp-image-372" title="Picture-121-300x157" src="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png" alt="" width="300" height="157" /></a></a>jQuery lovers, today, 14th of January, the programmers of jQuery celebrate its anniversary releasing a new version of this wonderful library. Better iFrame support, great new shorthands, I don&#8217;t know what to say fellows but I am eager to find out what its new features are capable of.</p>
<p>The jQuery programmers not happy with a new release has also created a new  <a href="http://api.jquery.com/" target="_blank">jQuery API site</a>. Check what they have done on their API site <a href="http://jquery14.com/pre-release-1/new-jquery-api-site" target="_blank">here</a>.</p>
<p>John Resig will announce 1.4 release details tomorrow but meanwhile, you can download it and see for yourself.</p>
<ul>
<li><a rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js">Download jQuery 1.4 from Google CDN</a></li>
<li><a rel="nofollow" href="http://code.jquery.com/jquery-1.4.js">Download jQuery 1.4 from Official jQuery website</a></li>
</ul>
<p>Also, if you want to learn more about what is new in jQuery 1.4 then you might find the following resources useful:</p>
<ol>
<li><a rel="nofollow" href="http://jquery14.com/">14 Days of jQuery</a></li>
<li><a rel="nofollow" href="http://blog.jquery.com/">Official jQuery Blog</a></li>
<li><a rel="nofollow" href="http://futurecolors.ru/jquery/">jQuery 1.4 Cheatsheet</a></li>
<li><a rel="nofollow" href="http://twitter.com/jquery">jQuery on Tweeter</a></li>
</ol>
<p>Check what is new or changed on this new release <a href="http://api.jquery.com/category/version/1.4/" target="_blank">here</a>.</p>
<p>Happy birthday jQuery! Thanks for the good work!<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2010/01/14/jquery-1-4-are-you-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookie jQuery Plugin</title>
		<link>http://www.ramirezcobos.com/2010/01/02/cookie-jquery-plugin/</link>
		<comments>http://www.ramirezcobos.com/2010/01/02/cookie-jquery-plugin/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 12:18:29 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=148</guid>
		<description><![CDATA[As published on my last post, JSON gives us the great possibility to save objects on Cookies. I have already created a JSON Plugin for jQuery, then, why not create one Cookie Plugin that, in conjunction with the JSON plugin, allows us to save objects on cookies? Well, the challenge was simple and I decided]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ramirezcobos.com/wp-content/uploads/2009/12/Picture-121.png"><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png"><img class="alignright size-full wp-image-372" title="Picture-121-300x157" src="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png" alt="" width="300" height="157" /></a></a>As published <a href="http://www.ramirezcobos.com/2010/01/01/cookies-on-roids/">on my last post</a>, JSON gives us the great possibility to save objects on Cookies. I have already created a JSON Plugin for jQuery, then, why not create one Cookie Plugin that, in conjunction with the JSON plugin, allows us to save objects on cookies? Well, the challenge was simple and I decided to do it for those using jQuery.</p>
<h3>The code</h3>
<p>Remember than this plugin works in conjunction with my <a href="http://www.ramirezcobos.com/2009/12/30/json-jquery-plugin/">JSON jQuery Plugin</a>, also on this blog.</p>
<pre class="brush: jscript;">
jQuery.cookie = {

set : function(name,value,options){

options = $.extend({}, options);

if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires &amp;&amp; (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString();
}

value = options.json ? encodeURIComponent($.JSON.encode(value)):encodeURIComponent(value);

var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';

document.cookie = [name, '=', value, expires, path, domain, secure].join('');
},
get : function(name,json){

var cookieValue = null;

if (document.cookie &amp;&amp; document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i &lt; cookies.length; i++) {
var cookie = $.trim(cookies[i]);
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = json ? $.JSON.decode(decodeURIComponent(cookie.substring(name.length + 1))):decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}

return cookieValue;

},
unset: function(name){
this.set(name,'',-1);
}
};
</pre>
<h3>How to use</h3>
<p>Note that you have to insert the jquery library on your head section and also the <a href="../2009/12/30/json-jquery-plugin/">JSON jQuery Plugin</a> -they are all included into the zip file below. Please, also refer to <a href="http://www.ramirezcobos.com/2010/01/01/cookies-on-roids/">the example provided on my last article &#8216;cookies on roids&#8217; </a>to view more cookie options.</p>
<pre class="brush: jscript;">
var obj = {json:'this is a test json property',xml:'this is a test xml property'};
var arr = ['A','B of 2 index array','C','D'];
var str = 'This is a string test';
var num = 123;

$.cookie.set('testobject',obj,{json:true});
$.cookie.set('testarray',arr,{json:true});
$.cookie.set('teststring',str);
$.cookie.set('testnumber',num);

var a = $.cookie.get('testobject',true);
var b = $.cookie.get('testarray',true);
var c = $.cookie.get('teststring');
var d = $.cookie.get('testnumber');

$.cookie.unset('testobject');
$.cookie.unset('testarray');
$.cookie.unset('teststring');
$.cookie.unset('testnumber');

alert('object:'+a.xml);
alert('array:'+b[1]);
alert('string:'+c);
alert('number:'+d);
</pre>
<p><strong>DOWNLOAD</strong><br />
The zip file includes the JSON jQuery Plugin and Cookie jQuery Plugin together with an example page on how to use them.</p>
<div style="padding: 10px; text-align: center; background-color: #ffffff; border: 3px solid #dddddd;"><table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.ramirezcobos.com/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.ramirezcobos.com/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.ramirezcobos.com/?file_id=6">jQuery Cookie Plugin</a> <small>(23.84KB)</small><br />
      <b>added:</b> 02/01/2010 <br />
      <b>clicks:</b> 426 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></div>
<script type="text/javascript"><!--
google_ad_client = "pub-7060132287364604";
/* 468x60, creado 16/03/10 */
google_ad_slot = "9029910384";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2010/01/02/cookie-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JSON jQuery Plugin</title>
		<link>http://www.ramirezcobos.com/2009/12/30/json-jquery-plugin/</link>
		<comments>http://www.ramirezcobos.com/2009/12/30/json-jquery-plugin/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 10:53:42 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=139</guid>
		<description><![CDATA[I finally got a bit of time and I started playing around with the creation of jQuery plugins and did created a couple of them that I believe all of you will find useful, one of them is a JSON plugin. As you all know jQuery do not have a JSON encode function. I truly]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ramirezcobos.com/wp-content/uploads/2009/12/Picture-121.png"><a href="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png"><img class="alignright size-full wp-image-372" title="Picture-121-300x157" src="http://www.ramirezcobos.com/wp-content/uploads/2010/03/Picture-121-300x157.png" alt="" width="300" height="157" /></a></a>I finally got a bit of time and I started playing around with the creation of jQuery plugins and did created a couple of them that I believe all of you will find useful, one of them is a JSON plugin.</p>
<p>As you all know jQuery do not have a JSON encode function. I truly do not know the reason why but to implement it was quite easy -maybe the guys from jQuery thought that it wasn&#8217;t really necessary and I agree with them. Most of us use JSON on the server side through PHP or whatever the server tech we use but sometimes, and I repeat, sometimes, we require to develop client applications that by using JSON (thanks David Crockford) we can reduce our server resources and the amount of data transmitted between client and server. But this is a subject that I will treat in the next posts.</p>
<p>Here is the plugin code:</p>
<pre class="brush: jscript;">
jQuery.JSON = {
useHasOwn : ({}.hasOwnProperty ? true : false),
pad : function(n) {
return n &lt; 10 ? "0" + n : n;
},
m : {
"\b": '\\b',
"\t": '\\t',
"\n": '\\n',
"\f": '\\f',
"\r": '\\r',
'"' : '\\"',
"\\": '\\\\'
},
encodeString : function(s){
if (/["\\\x00-\x1f]/.test(s)) {
return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
var c = m[b];
if(c){
return c;
}
c = b.charCodeAt();
return "\\u00" +
Math.floor(c / 16).toString(16) +
(c % 16).toString(16);
}) + '"';
}
return '"' + s + '"';
},
encodeArray : function(o){
var a = ["["], b, i, l = o.length, v;
for (i = 0; i &lt; l; i += 1) {
v = o[i];
switch (typeof v) {
case "undefined":
case "function":
case "unknown":
break;
default:
if (b) {
a.push(',');
}
a.push(v === null ? "null" : this.encode(v));
b = true;
}
}
a.push("]");
return a.join("");
},
encodeDate : function(o){
return '"' + o.getFullYear() + "-" +
pad(o.getMonth() + 1) + "-" +
pad(o.getDate()) + "T" +
pad(o.getHours()) + ":" +
pad(o.getMinutes()) + ":" +
pad(o.getSeconds()) + '"';
},
encode : function(o){
if(typeof o == "undefined" || o === null){
return "null";
}else if(o instanceof Array){
return this.encodeArray(o);
}else if(o instanceof Date){
return this.encodeDate(o);
}else if(typeof o == "string"){
return this.encodeString(o);
}else if(typeof o == "number"){
return isFinite(o) ? String(o) : "null";
}else if(typeof o == "boolean"){
return String(o);
}else {
var self = this;

var a = ["{"], b, i, v;
for (i in o) {
if(!this.useHasOwn || o.hasOwnProperty(i)) {
v = o[i];
switch (typeof v) {
case "undefined":
case "function":
case "unknown":
break;
default:
if(b){
a.push(',');
}
a.push(self.encode(i), ":",
v === null ? "null" : self.encode(v));
b = true;
}
}
}
a.push("}");
return a.join("");
}
},
decode : function(json){
return eval("(" + json + ')');
}
};
</pre>
<p>How to use</p>
<p>Copy and paste the above code onto a file and name it whatever you like, for the sake of the example we will call it<strong> jquery.json.js</strong>. And then configure your head section like this:</p>
<pre class="brush: xml;">
&lt;!-- jquery library (if you dont have it, then download it <img src='http://www.ramirezcobos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  --&gt;
&lt;script language="javascript" src="jquery.1.3.2.js" &gt;&lt;/script&gt;
&lt;!-- our plugin file --&gt;
&lt;script language="javascript" src="jquery.json.js"&gt;&lt;/script&gt;
</pre>
<p>That&#8217;s it, now we can call our plugin like this:</p>
<pre class="brush: jscript;">
// test variables
var obj = {json:'this is a test json property',xml:'this is a test xml property'};
var arr = ['A','B of 2 index array','C','D'];

// encoding an object
var a = $.JSON.encode(obj);
alert('json encoded object:'+a);

// decoding an object
var b = $.JSON.decode(a);
alert('json decoded object property:'+b.json);

// encoding an array
a = $.JSON.encode(arr);
alert('json encoded array:'+a);

// decoding the array
b = $.JSON.decode(a);
alert('json decoded array:'+b[1]);
</pre>
<p>On future posts we will make use of this plugin to show what we can do with it.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-7060132287364604";
/* 468x60, creado 16/03/10 */
google_ad_slot = "9029910384";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2009/12/30/json-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ajax Powered Autocomplete Plugin for JQuery.js</title>
		<link>http://www.ramirezcobos.com/2009/12/29/ajax-powered-autocomplete-plugin-for-jquery-js/</link>
		<comments>http://www.ramirezcobos.com/2009/12/29/ajax-powered-autocomplete-plugin-for-jquery-js/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 10:44:23 +0000</pubDate>
		<dc:creator>Antonio Ramirez</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Autocomplete]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.ramirezcobos.com/?p=134</guid>
		<description><![CDATA[I am glad to announce the launch of the successfull Ajax Powered Autocomplete for Prototype.js now as a plugin for JQuery. No much to say&#8230; if any of you want to have a look at this piece of code you can check it here. Any feedback is highly appreciated.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ramirezcobos.com/wp-content/uploads/2009/12/autocomplete1.gif"><img class="alignright size-full wp-image-46" style="border: 3px solid #ddd; margin: 5px;" title="autocomplete" src="http://www.ramirezcobos.com/wp-content/uploads/2009/12/autocomplete1.gif" alt="" width="240" height="262" /></a>I am glad to announce the launch of the successfull Ajax Powered Autocomplete for Prototype.js now as a plugin for JQuery. No much to say&#8230; if any of you want to have a look at this piece of code <a href="http://www.ramirezcobos.com/labs/autocomplete-for-jquery-js/">you can check it here</a>.</p>
<p>Any feedback is highly appreciated.</p>
<p><center><br />
<br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramirezcobos.com/2009/12/29/ajax-powered-autocomplete-plugin-for-jquery-js/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
