<?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>JQuery, PHP, html, design... // arnaud-k : un blog de geek &#187; astuce JQuery</title>
	<atom:link href="http://blog.arnaud-k.fr/tag/astuce-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.arnaud-k.fr</link>
	<description>Le blog JQuery, Html, Web Design</description>
	<lastBuildDate>Thu, 21 Apr 2011 08:10:17 +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>Astuce JQuery : la fonction serialize ()</title>
		<link>http://blog.arnaud-k.fr/2010/03/08/astuce-jquery-la-fonction-serialize/</link>
		<comments>http://blog.arnaud-k.fr/2010/03/08/astuce-jquery-la-fonction-serialize/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:51:00 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[astuce JQuery]]></category>
		<category><![CDATA[serialize]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1627</guid>
		<description><![CDATA[Après le précédent billet présentant la fonction clone de JQuery, j&#8217;ai décidé de te parler d&#8217;une autre fonction méconnue de JQuery : la fonction serialize. Alors que fait-elle cette fonction ? Pour appeler serialize, il faut avoir en sélecteur un&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2010/03/08/astuce-jquery-la-fonction-serialize/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F03%2F08%2Fastuce-jquery-la-fonction-serialize%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F03%2F08%2Fastuce-jquery-la-fonction-serialize%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Après le précédent billet présentant <a href="http://blog.arnaud-k.fr/2010/developpement-web/cat-jquery/astuce-jquery-du-jour-la-fonction-clone/" title="la fonction clone de JQuery">la fonction clone de JQuery</a>, j&#8217;ai décidé de te parler d&#8217;<strong>une autre fonction méconnue de JQuery : la fonction serialize.</strong></p>
<p>Alors que fait-elle cette fonction ?</p>
<p>Pour appeler serialize, il faut avoir en sélecteur un formulaire. <strong>Serialize va tout simplement retourner une chaine de caractères contenant toutes les valeurs des champs de ce formulaire.</strong> La chaine est formatée pour être envoyée en Ajax par la suite ( de type <em>champ1=valeur1&amp;champ2=valeur2&amp;champ3=valeur3</em>&#8230; ). La où la fonction serialize va être utile, c&#8217;est qu&#8217;elle permet de créer une fonction qui va permettre d&#8217;envoyer n&#8217;importe quel formulaire en Ajax avec une seule fonction.</p>
<p>Comme d&#8217;habitude, la demo est par là :<br />
<a href="http://blog.arnaud-k.fr/demos/jquery-serialize/" title="demo de la fonction serialize" class="demo">demo de la fonction serialize</a></p>
<p>Admettons que l&#8217;<strong>on ajoute la classe &laquo;&nbsp;ajax&nbsp;&raquo; à tous les formulaires</strong> que l&#8217;on souhaite envoyer en Ajax :</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ajax&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;data.php&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nom&quot;</span>&gt;</span>Nom :<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nom&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nom&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span>&gt;</span>Email :<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;typeform&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inscription&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inscription&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

<p>Ici, j&#8217;ai créé un formulaire d&#8217;inscription simple demandant seulement un nom et un email. Un champ caché (nommé typeform) va permettre de différencier le formulaire des autres pour le traitement en PHP (en assumant que tous les traitements en Ajax se passe dans le même fichier).</p>
<p>Le JQuery va être ici très simple (en connaissant les bases de JQuery <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'form.ajax'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on empeche l'envoi du formulaire par le navigateur</span>
     <span style="color: #003366; font-weight: bold;">var</span> datas <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
          type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'POST'</span><span style="color: #339933;">,</span>      <span style="color: #006600; font-style: italic;">// envoi des données en POST</span>
          url<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'action'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>     <span style="color: #006600; font-style: italic;">// envoi au fichier défini dans l'attribut action</span>
          data<span style="color: #339933;">:</span> datas<span style="color: #339933;">,</span>     <span style="color: #006600; font-style: italic;">// sélection des champs à envoyer</span>
          success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>     <span style="color: #006600; font-style: italic;">// callback en cas de succès</span>
               <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'success : '</span><span style="color: #339933;">+</span>datas<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>C&#8217;était simple non ? <strong>La fonction serialize de JQuery est toute simple, mais super utile !</strong> Elle permet vraiment de factoriser le code.</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2010/03/08/astuce-jquery-la-fonction-serialize/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Astuce JQuery du jour : la fonction clone()</title>
		<link>http://blog.arnaud-k.fr/2010/03/03/astuce-jquery-du-jour-la-fonction-clone/</link>
		<comments>http://blog.arnaud-k.fr/2010/03/03/astuce-jquery-du-jour-la-fonction-clone/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:47:39 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[astuce JQuery]]></category>
		<category><![CDATA[clone]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1595</guid>
		<description><![CDATA[JQuery propose par défaut des tas de fonctions super utiles mais qui sont assez peu utilisées. J&#8217;ai découvert la fonction clone il y a peu (en jetant un oeil sur mon mémento JQuery 1.4). Tu l&#8217;as peut-être deviné, la fonction&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2010/03/03/astuce-jquery-du-jour-la-fonction-clone/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F03%2F03%2Fastuce-jquery-du-jour-la-fonction-clone%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F03%2F03%2Fastuce-jquery-du-jour-la-fonction-clone%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p class="aligncenter"><img class="size-full wp-image-1610" title="tech_clone_armure1_01" src="http://blog.arnaud-k.fr/wp-content/uploads/2010/03/tech_clone_armure1_011.jpg" alt="" width="500" height="140" /></p>
<p style="text-align: left;"><strong>JQuery propose par défaut</strong> <strong>des tas de fonctions super utiles</strong> mais qui sont assez peu utilisées. J&#8217;ai découvert la fonction clone il y a peu (en jetant un oeil sur mon <a href="http://www.futurecolors.ru/jquery/jquery.cheatsheet.1.4.pdf">mémento JQuery 1.4</a>). Tu l&#8217;as peut-être deviné, la fonction clone() permet de dupliquer un élément du DOM dans la page.</p>
<p style="text-align: left;">Comme d&#8217;hab, je t&#8217;ai préparé une petite démo :</p>
<p><a class="demo" title="voir la demo" href="http://blog.arnaud-k.fr/demos/jquery-clone/">Demo</a></p>
<p>Pour mon exemple on va dupliquer une liste déroulante &lt;select&gt; (en fait tout le paragraphe qui le contient) pour permettre à l&#8217;utilisateur de sélectionner plusieurs catégories :</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;categorie&quot;</span>&gt;</span>Choisissez une catégorie :<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cat&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;categorie[]&quot;</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span>&gt;</span>Sélectionnez une catégorie<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery&quot;</span>&gt;</span>JQuery<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;html&quot;</span>&gt;</span>HTML<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;php&quot;</span>&gt;</span>PHP<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css&quot;</span>&gt;</span>CSS<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span></pre></div></div>

<p>Les crochets à la fin de l&#8217;attribut <em>name</em> du select nous permettra de récupérer les valeurs des plusieurs select dupliqués en faisant un simple foreach (en PHP).</p>
<p><strong>Passons maintenant à la partie JQuery</strong> (attention ça va aller très vite !) :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select.cat:last'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'change'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span> <span style="color: #009900;">&#41;</span>
          <span style="color: #009900;">&#123;</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clone</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">insertAfter</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Et voilà ! Comme tu le sais probablement déjà la ligne 1 permet d&#8217;attendre que la page soit fini de charger (que le DOM soit ready).</p>
<p>A la ligne 2, le sélecteur <em>select.cat:last</em> permet de sélectionner uniquement le dernier select ayant la classe &laquo;&nbsp;cat&nbsp;&raquo;. Pour plus de renseignements sur l&#8217;événement &laquo;&nbsp;live&nbsp;&raquo;, je t&#8217;invite à relire <a href="http://blog.arnaud-k.fr/2009/developpement-web/cat-jquery/utilisation-de-levenement-live-de-jquery/">mon précédent article sur ce sujet</a>. Donc quand la valeur de ce dernier select change, on exécute la suite.</p>
<p>La ligne 3 permet de tester si la valeur du select n&#8217;est pas vide.</p>
<p>L&#8217;astuce du jour se trouve véritablement à la ligne 5. Tout d&#8217;abord on sélectionne le parent du select (<em><a href="http://api.jquery.com/parent/">.parent()</a></em>). On a donc tout le paragraphe. Ensuite on clone ce paragraphe (<em><a href="http://api.jquery.com/clone/">.clone()</a></em>) et on l&#8217;insère après (<em><a href="http://api.jquery.com/insertAfter/">insertAfter()</a></em>) le paragraphe contenant le dernier select.</p>
<p>Ce n&#8217;était pas si compliqué que ça ? <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Et enfin, et parce que je suis super sympa, <strong>voici comment on récupère les valeurs en PHP</strong> de tous les select générés :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'categorie'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'categorie'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$categorie</span> <span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categorie</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'
'</span><span style="color: #339933;">;</span>
          <span style="color: #666666; font-style: italic;">// faire ici le traitement voulu, le foreach va parcourir toutes les catégories du tableau</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Voili, voilou (comme dirait <a href="http://images.google.fr/images?q=flanders">Flanders</a>), c&#8217;était <strong>le retour des articles avec plein de JQuery</strong> dedans. Tiens-toi prêt, j&#8217;ai d&#8217;autres petites astuces en stock ! <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2010/03/03/astuce-jquery-du-jour-la-fonction-clone/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

