<?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>Pais porrada de Bethrezen &#187; jquery</title> <atom:link href="http://blog.bethrezen.ru/tag/jquery/feed" rel="self" type="application/rss+xml" /><link>http://blog.bethrezen.ru</link> <description>Блог веб-программиста</description> <lastBuildDate>Sat, 27 Aug 2011 08:51:33 +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>Почему disabled input элементы формы не передаются?</title><link>http://blog.bethrezen.ru/2009/06/disabled-input-fields.html</link> <comments>http://blog.bethrezen.ru/2009/06/disabled-input-fields.html#comments</comments> <pubDate>Tue, 30 Jun 2009 09:42:00 +0000</pubDate> <dc:creator>Bethrezen</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[html]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jquery]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[Сегодня столкнулся с одной особенностью INPUT элементов с атрибутом disabled. Как оказалось &#8211; они не передаются серверу при сабмите формы. Вышел из положения вот таким изящным способом на jQuery: $&#40;function&#40;&#41;&#123; $&#40;&#34;form&#34;&#41;.submit&#40;function&#40;&#41;&#123; $&#40;&#34;input&#34;&#41;.attr&#40;&#34;disabled&#34;, &#34;&#34;&#41;; $&#40;&#34;select&#34;&#41;.attr&#40;&#34;disabled&#34;, &#34;&#34;&#41;; &#125;&#41;; &#125;&#41;; Таким образом, при действии submit у всех input и select элементов убирается атрибут disabled. Один минус &#8211; не [...]]]></description> <content:encoded><![CDATA[<p>Сегодня столкнулся с одной особенностью INPUT элементов с атрибутом disabled. Как оказалось &#8211; они не передаются серверу при сабмите формы.<br
/> Вышел из положения вот таким изящным способом на jQuery:</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;color: #FCFFBA;">$<span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #003366; font-weight: bold;color: #577A61;">function</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #009900;color: #CCC;">&#123;</span>
 $<span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #3366CC;color: #111;">&quot;form&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #003366; font-weight: bold;color: #577A61;">function</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #009900;color: #CCC;">&#123;</span>
 $<span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #3366CC;color: #111;">&quot;input&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #3366CC;color: #111;">&quot;disabled&quot;</span><span style="color: #339933;color: #CCC;">,</span> <span style="color: #3366CC;color: #111;">&quot;&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span> $<span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #3366CC;color: #111;">&quot;select&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #3366CC;color: #111;">&quot;disabled&quot;</span><span style="color: #339933;color: #CCC;">,</span> <span style="color: #3366CC;color: #111;">&quot;&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span></pre></div></div><p>Таким образом, при действии submit у всех input и select элементов убирается атрибут disabled. Один минус &#8211; не работает при отключенных скриптах. Но в моём случае без JavaScript и jQuery не работает вообще всё приложение, так что это не так страшно.</p> ]]></content:encoded> <wfw:commentRss>http://blog.bethrezen.ru/2009/06/disabled-input-fields.html/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>jQuery Serialize &#8211; PHP like serialize function for jQuery</title><link>http://blog.bethrezen.ru/2009/06/jquery-serialize-php-function-for-jquery.html</link> <comments>http://blog.bethrezen.ru/2009/06/jquery-serialize-php-function-for-jquery.html#comments</comments> <pubDate>Thu, 25 Jun 2009 09:04:00 +0000</pubDate> <dc:creator>Bethrezen</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[php]]></category> <category><![CDATA[serialize]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[ENG: I&#8217;ve addapted a JavaScript serialize function by Kevin van Zonneveld to jQuery. Function works like the same named function in PHP. Be free to use it in your projects. It is especially needed when you want to post Object in AJAX (in jQuery &#171;$.ajax()&#187;). RUS: Я адаптировал JavaScript serialize функцию, написанную Kevin van Zonneveld, [...]]]></description> <content:encoded><![CDATA[<p><span
style="font-weight: bold;">ENG</span>: I&#8217;ve addapted a <span
style="font-weight: bold;">JavaScript serialize function</span> by <a
rel="nofollow" href="http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_serialize/">Kevin van Zonneveld</a> to <span
style="font-weight: bold;">jQuery</span>. Function works like the same named function in PHP. Be free to use it in your projects. It is especially needed when you want to post Object in AJAX (in jQuery &laquo;$.ajax()&raquo;).<br
/> <span
style="font-weight: bold;">RUS</span>: Я адаптировал JavaScript serialize функцию, написанную Kevin van Zonneveld, для использования с jQuery. Serialize работает также как и одноименная функция в PHP. Она хорошо выручит Вас, если Вы захотите передать в AJAX запросе Объект (JavaScript object).</p><p>Example of using: $.serialize({data: &#8216;value&#8217;});<br
/> <span
id="more-54"></span><br
/> Source code<span
style="font-weight: bold;">(UPDATE-1)</span>:</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;color: #FCFFBA;">jQuery.<span style="color: #660066;">extend</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009900;color: #CCC;">&#123;</span>
 serialize<span style="color: #339933;color: #CCC;">:</span> <span style="color: #003366; font-weight: bold;color: #577A61;">function</span> <span style="color: #009900;color: #CCC;">&#40;</span> mixed_value <span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// Returns a string representation of variable (which can later be unserialized)</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">//</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// version: 906.1807</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// discuss at: http://phpjs.org/functions/serialize</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// +   original by: Arpad Ray (mailto:arpad@php.net)</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// +   improved by: Dino</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// +   bugfixed by: Andrej Pavlovic</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// +   bugfixed by: Garagoth</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// +      input by: DtTvB (http://dt.in.th/2008-09-16.string-length-in-bytes.html)</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// +   bugfixed by: Russell Walker (http://www.nbill.co.uk/)</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// %          note: We feel the main purpose of this function should be to ease the transport of data between php &amp; js</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// %          note: Aiming for PHP-compatibility, we have to translate objects to arrays</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// *     example 1: serialize(['Kevin', 'van', 'Zonneveld']);</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// *     returns 1: 'a:3:{i:0;s:5:&quot;Kevin&quot;;i:1;s:3:&quot;van&quot;;i:2;s:9:&quot;Zonneveld&quot;;}'</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// *     example 2: serialize({firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'});</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">// *     returns 2: 'a:3:{s:9:&quot;firstName&quot;;s:5:&quot;Kevin&quot;;s:7:&quot;midName&quot;;s:3:&quot;van&quot;;s:7:&quot;surName&quot;;s:9:&quot;Zonneveld&quot;;}'</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> _getType <span style="color: #339933;color: #CCC;">=</span> <span style="color: #003366; font-weight: bold;color: #577A61;">function</span><span style="color: #009900;color: #CCC;">&#40;</span> inp <span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> type <span style="color: #339933;color: #CCC;">=</span> <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">typeof</span> inp<span style="color: #339933;color: #CCC;">,</span> match<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> key<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span>type <span style="color: #339933;color: #CCC;">==</span> <span style="color: #3366CC;color: #111;">'object'</span> <span style="color: #339933;color: #CCC;">&amp;&amp;</span> <span style="color: #339933;color: #CCC;">!</span>inp<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">return</span> <span style="color: #3366CC;color: #111;">'null'</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span>type <span style="color: #339933;color: #CCC;">==</span> <span style="color: #3366CC;color: #111;">&quot;object&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #339933;color: #CCC;">!</span>inp.<span style="color: #660066;">constructor</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">return</span> <span style="color: #3366CC;color: #111;">'object'</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> cons <span style="color: #339933;color: #CCC;">=</span> inp.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">toString</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 match <span style="color: #339933;color: #CCC;">=</span> cons.<span style="color: #660066;">match</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009966; font-style: italic;">/(\w+)\(/</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span>match<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 cons <span style="color: #339933;color: #CCC;">=</span> match<span style="color: #009900;color: #CCC;">&#91;</span><span style="color: #CC0000;color: #DDD;">1</span><span style="color: #009900;color: #CCC;">&#93;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> types <span style="color: #339933;color: #CCC;">=</span> <span style="color: #009900;color: #CCC;">&#91;</span><span style="color: #3366CC;color: #111;">&quot;boolean&quot;</span><span style="color: #339933;color: #CCC;">,</span> <span style="color: #3366CC;color: #111;">&quot;number&quot;</span><span style="color: #339933;color: #CCC;">,</span> <span style="color: #3366CC;color: #111;">&quot;string&quot;</span><span style="color: #339933;color: #CCC;">,</span> <span style="color: #3366CC;color: #111;">&quot;array&quot;</span><span style="color: #009900;color: #CCC;">&#93;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">for</span> <span style="color: #009900;color: #CCC;">&#40;</span>key <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">in</span> types<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span>cons <span style="color: #339933;color: #CCC;">==</span> types<span style="color: #009900;color: #CCC;">&#91;</span>key<span style="color: #009900;color: #CCC;">&#93;</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 type <span style="color: #339933;color: #CCC;">=</span> types<span style="color: #009900;color: #CCC;">&#91;</span>key<span style="color: #009900;color: #CCC;">&#93;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">return</span> type<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> type <span style="color: #339933;color: #CCC;">=</span> _getType<span style="color: #009900;color: #CCC;">&#40;</span>mixed_value<span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> val<span style="color: #339933;color: #CCC;">,</span> ktype <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">''</span><span style="color: #339933;color: #CCC;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">switch</span> <span style="color: #009900;color: #CCC;">&#40;</span>type<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;function&quot;</span><span style="color: #339933;color: #CCC;">:</span>
 val <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">&quot;&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;boolean&quot;</span><span style="color: #339933;color: #CCC;">:</span>
 val <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">&quot;b:&quot;</span> <span style="color: #339933;color: #CCC;">+</span> <span style="color: #009900;color: #CCC;">&#40;</span>mixed_value <span style="color: #339933;color: #CCC;">?</span> <span style="color: #3366CC;color: #111;">&quot;1&quot;</span> <span style="color: #339933;color: #CCC;">:</span> <span style="color: #3366CC;color: #111;">&quot;0&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;number&quot;</span><span style="color: #339933;color: #CCC;">:</span>
 val <span style="color: #339933;color: #CCC;">=</span> <span style="color: #009900;color: #CCC;">&#40;</span>Math.<span style="color: #660066;">round</span><span style="color: #009900;color: #CCC;">&#40;</span>mixed_value<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #339933;color: #CCC;">==</span> mixed_value <span style="color: #339933;color: #CCC;">?</span> <span style="color: #3366CC;color: #111;">&quot;i&quot;</span> <span style="color: #339933;color: #CCC;">:</span> <span style="color: #3366CC;color: #111;">&quot;d&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #339933;color: #CCC;">+</span> <span style="color: #3366CC;color: #111;">&quot;:&quot;</span> <span style="color: #339933;color: #CCC;">+</span> mixed_value<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;string&quot;</span><span style="color: #339933;color: #CCC;">:</span>
 val <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">&quot;s:&quot;</span> <span style="color: #339933;color: #CCC;">+</span> encodeURIComponent<span style="color: #009900;color: #CCC;">&#40;</span>mixed_value<span style="color: #009900;color: #CCC;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009966; font-style: italic;">/%../g</span><span style="color: #339933;color: #CCC;">,</span> <span style="color: #3366CC;color: #111;">'x'</span><span style="color: #009900;color: #CCC;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;color: #CCC;">+</span> <span style="color: #3366CC;color: #111;">&quot;:<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;color: #CCC;">+</span> mixed_value <span style="color: #339933;color: #CCC;">+</span> <span style="color: #3366CC;color: #111;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;array&quot;</span><span style="color: #339933;color: #CCC;">:</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;object&quot;</span><span style="color: #339933;color: #CCC;">:</span>
 val <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">&quot;a&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #006600; font-style: italic;color: #CDC;">/*
 if (type == &quot;object&quot;) {
 var objname = mixed_value.constructor.toString().match(/(\w+)\(\)/);
 if (objname == undefined) {
 return;
 }
 objname[1] = serialize(objname[1]);
 val = &quot;O&quot; + objname[1].substring(1, objname[1].length - 1);
 }
 */</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> count <span style="color: #339933;color: #CCC;">=</span> <span style="color: #CC0000;color: #DDD;">0</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> vals <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">&quot;&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> okey<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">var</span> key<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">for</span> <span style="color: #009900;color: #CCC;">&#40;</span>key <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">in</span> mixed_value<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 ktype <span style="color: #339933;color: #CCC;">=</span> _getType<span style="color: #009900;color: #CCC;">&#40;</span>mixed_value<span style="color: #009900;color: #CCC;">&#91;</span>key<span style="color: #009900;color: #CCC;">&#93;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span>ktype <span style="color: #339933;color: #CCC;">==</span> <span style="color: #3366CC;color: #111;">&quot;function&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">continue</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
&nbsp;
okey <span style="color: #339933;color: #CCC;">=</span> <span style="color: #009900;color: #CCC;">&#40;</span>key.<span style="color: #660066;">match</span><span style="color: #009900;color: #CCC;">&#40;</span><span style="color: #009966; font-style: italic;">/^[0-9]+$/</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #339933;color: #CCC;">?</span> parseInt<span style="color: #009900;color: #CCC;">&#40;</span>key<span style="color: #339933;color: #CCC;">,</span> <span style="color: #CC0000;color: #DDD;">10</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #339933;color: #CCC;">:</span> key<span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 vals <span style="color: #339933;color: #CCC;">+=</span> $.<span style="color: #660066;">serialize</span><span style="color: #009900;color: #CCC;">&#40;</span>okey<span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #339933;color: #CCC;">+</span>
 $.<span style="color: #660066;">serialize</span><span style="color: #009900;color: #CCC;">&#40;</span>mixed_value<span style="color: #009900;color: #CCC;">&#91;</span>key<span style="color: #009900;color: #CCC;">&#93;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span>
 count<span style="color: #339933;color: #CCC;">++;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 val <span style="color: #339933;color: #CCC;">+=</span> <span style="color: #3366CC;color: #111;">&quot;:&quot;</span> <span style="color: #339933;color: #CCC;">+</span> count <span style="color: #339933;color: #CCC;">+</span> <span style="color: #3366CC;color: #111;">&quot;:{&quot;</span> <span style="color: #339933;color: #CCC;">+</span> vals <span style="color: #339933;color: #CCC;">+</span> <span style="color: #3366CC;color: #111;">&quot;}&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">case</span> <span style="color: #3366CC;color: #111;">&quot;undefined&quot;</span><span style="color: #339933;color: #CCC;">:</span> <span style="color: #006600; font-style: italic;color: #CDC;">// Fall-through</span>
 <span style="color: #003366; font-weight: bold;color: #577A61;">default</span><span style="color: #339933;color: #CCC;">:</span> <span style="color: #006600; font-style: italic;color: #CDC;">// if the JS object has a property which contains a null value, the string cannot be unserialized by PHP</span>
 val <span style="color: #339933;color: #CCC;">=</span> <span style="color: #3366CC;color: #111;">&quot;N&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">break</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">if</span> <span style="color: #009900;color: #CCC;">&#40;</span>type <span style="color: #339933;color: #CCC;">!=</span> <span style="color: #3366CC;color: #111;">&quot;object&quot;</span> <span style="color: #339933;color: #CCC;">&amp;&amp;</span> type <span style="color: #339933;color: #CCC;">!=</span> <span style="color: #3366CC;color: #111;">&quot;array&quot;</span><span style="color: #009900;color: #CCC;">&#41;</span> <span style="color: #009900;color: #CCC;">&#123;</span>
 val <span style="color: #339933;color: #CCC;">+=</span> <span style="color: #3366CC;color: #111;">&quot;;&quot;</span><span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #000066; font-weight: bold;color:#DD2A24;font-weight:bold;">return</span> val<span style="color: #339933;color: #CCC;">;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span>
 <span style="color: #009900;color: #CCC;">&#125;</span><span style="color: #009900;color: #CCC;">&#41;</span><span style="color: #339933;color: #CCC;">;</span></pre></div></div><p>UPDATES:<br
/> #1 &#8211; Patched version for working correctly with null, undefined values, subobjects.</p><p>NJoy</p> ]]></content:encoded> <wfw:commentRss>http://blog.bethrezen.ru/2009/06/jquery-serialize-php-function-for-jquery.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>DailySnap: DropDown jQuery Navigation Menu</title><link>http://blog.bethrezen.ru/2009/01/dailysnap-dropdown-jquery-navigation-menu.html</link> <comments>http://blog.bethrezen.ru/2009/01/dailysnap-dropdown-jquery-navigation-menu.html#comments</comments> <pubDate>Sun, 25 Jan 2009 12:47:00 +0000</pubDate> <dc:creator>Bethrezen</dc:creator> <category><![CDATA[Новости]]></category> <category><![CDATA[dailysnap]]></category> <category><![CDATA[jquery]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[Выпадающее меню навигации v0.1. Простенькое выпадающее меню на jQuery. Использует модуль категорий для динамической генерации HTML разметки на UL-ах. Реализовано как CWidget. Использовалось: jQuery, CSS, The Gimp для фона и картинок, Yii Framework]]></description> <content:encoded><![CDATA[<p><img
src="http://img-fotki.yandex.ru/get/3104/b37hr3z3n.3/0_206a0_e57da30e_orig" alt=" DailySnap: DropDown jQuery Navigation Menu" width="303" height="186" title="DailySnap: DropDown jQuery Navigation Menu" /></p><p>Выпадающее меню навигации v0.1.<br
/> Простенькое выпадающее меню на jQuery. Использует модуль категорий для динамической генерации HTML разметки на UL-ах. Реализовано как CWidget.<br
/> Использовалось: jQuery, CSS, The Gimp для фона и картинок, Yii Framework</p> ]]></content:encoded> <wfw:commentRss>http://blog.bethrezen.ru/2009/01/dailysnap-dropdown-jquery-navigation-menu.html/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>DailySnap &#8211; Категории</title><link>http://blog.bethrezen.ru/2009/01/dailysnap-%d0%ba%d0%b0%d1%82%d0%b5%d0%b3%d0%be%d1%80%d0%b8%d0%b8.html</link> <comments>http://blog.bethrezen.ru/2009/01/dailysnap-%d0%ba%d0%b0%d1%82%d0%b5%d0%b3%d0%be%d1%80%d0%b8%d0%b8.html#comments</comments> <pubDate>Wed, 21 Jan 2009 10:01:00 +0000</pubDate> <dc:creator>Bethrezen</dc:creator> <category><![CDATA[Новости]]></category> <category><![CDATA[dailysnap]]></category> <category><![CDATA[jquery]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[Вот решил сделать новую рубрику DailySnap. Буду выкладывать скриншоты дня. Первый скриншот: Админка категорий v0.1. Ну чем вам не скиновое GUI приложение? jQuery UI, treeTable, Yii Framework]]></description> <content:encoded><![CDATA[<p>Вот решил сделать новую рубрику DailySnap. Буду выкладывать скриншоты дня.</p><p>Первый скриншот:</p><p><img
src="http://img-fotki.yandex.ru/get/2712/b37hr3z3n.3/0_201b6_297811c_orig" alt=" DailySnap   Категории" width="455" height="330" title="DailySnap   Категории" /></p><p>Админка категорий v0.1.<br
/> Ну чем вам не скиновое GUI приложение?<br
/> jQuery UI, treeTable, Yii Framework</p> ]]></content:encoded> <wfw:commentRss>http://blog.bethrezen.ru/2009/01/dailysnap-%d0%ba%d0%b0%d1%82%d0%b5%d0%b3%d0%be%d1%80%d0%b8%d0%b8.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 36/65 queries in 0.027 seconds using apc

Served from: blog.bethrezen.ru @ 2012-02-06 13:53:34 -->
