<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: UED &#8211; URL Encoded Data</title>
	<atom:link href="http://ajaxian.com/archives/ued-url-encoded-data/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/ued-url-encoded-data</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: zoiz</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248601</link>
		<dc:creator>zoiz</dc:creator>
		<pubDate>Sat, 24 Mar 2007 03:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248601</guid>
		<description>can anyone tell me how to get the value in the URL using javascript?
like $_GET in php and Request.QueryString in ASP.

Thanks alot.</description>
		<content:encoded><![CDATA[<p>can anyone tell me how to get the value in the URL using javascript?<br />
like $_GET in php and Request.QueryString in ASP.</p>
<p>Thanks alot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248293</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Fri, 16 Mar 2007 18:26:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248293</guid>
		<description>This string is perfect for &lt;a href=&quot;http://it2.php.net/manual/en/function.parse-str.php&quot; rel=&quot;nofollow&quot;&gt;parse_str&lt;/a&gt; php function (and He calls a php page :D) but this kind of query string has different problems:
1 - it&#039;s not standard (not implemented on every other program languages)
2 - it&#039;s more redundant than JSON (how many times You need to write array name? arr[]= ... arr[] ... now think on big arrays or objects)
3 - it doesn&#039;t preseve native variable type, in your example the year 2007 will be recieved as a string, as boolean, float, int, null and other values ... 

So, do we really need this &quot;new&quot; JSON alternative?</description>
		<content:encoded><![CDATA[<p>This string is perfect for <a href="http://it2.php.net/manual/en/function.parse-str.php" rel="nofollow">parse_str</a> php function (and He calls a php page :D) but this kind of query string has different problems:<br />
1 &#8211; it&#8217;s not standard (not implemented on every other program languages)<br />
2 &#8211; it&#8217;s more redundant than JSON (how many times You need to write array name? arr[]= &#8230; arr[] &#8230; now think on big arrays or objects)<br />
3 &#8211; it doesn&#8217;t preseve native variable type, in your example the year 2007 will be recieved as a string, as boolean, float, int, null and other values &#8230; </p>
<p>So, do we really need this &#8220;new&#8221; JSON alternative?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arron Bates</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248286</link>
		<dc:creator>Arron Bates</dc:creator>
		<pubDate>Fri, 16 Mar 2007 16:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248286</guid>
		<description>The URL can take 2k of data... which is a pretty large sized request. But it can get even more simpler than this... just take the JSON string and escape it into the URL. Let a server side parser just get the entire querystring, decode it and parse it with a JSON library... then the rest of the processing can happen.

You end up with pretty nasty URL&#039;s, but it handles a pretty sizable amount of data, and you can&#039;t get any easier (no special libraries needed). The URL&#039;s look like thus....

http://127.0.0.1:8080/something?%7BparamOne%3A%22something%22%2CparamTwo%3A%7Bid%3A12%2Cgood%3Afalse%2Cstring%3A%22something%20more%22%7D%7D

...which isn&#039;t uber pretty, but the client and the server side are *very* happy to play with it.</description>
		<content:encoded><![CDATA[<p>The URL can take 2k of data&#8230; which is a pretty large sized request. But it can get even more simpler than this&#8230; just take the JSON string and escape it into the URL. Let a server side parser just get the entire querystring, decode it and parse it with a JSON library&#8230; then the rest of the processing can happen.</p>
<p>You end up with pretty nasty URL&#8217;s, but it handles a pretty sizable amount of data, and you can&#8217;t get any easier (no special libraries needed). The URL&#8217;s look like thus&#8230;.</p>
<p><a href="http://127.0.0.1:8080/something?%7BparamOne%3A%22something%22%2CparamTwo%3A%7Bid%3A12%2Cgood%3Afalse%2Cstring%3A%22something%20more%22%7D%7D" rel="nofollow">http://127.0.0.1:8080/something?%7BparamOne%3A%22something%22%2CparamTwo%3A%7Bid%3A12%2Cgood%3Afalse%2Cstring%3A%22something%20more%22%7D%7D</a></p>
<p>&#8230;which isn&#8217;t uber pretty, but the client and the server side are *very* happy to play with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248241</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Fri, 16 Mar 2007 09:42:13 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248241</guid>
		<description>@Dean: This encoding is also useful for the post body which doesn&#039;t have a limit and is properly encoded by PHP into the $_POST variable.

@Eric: They are similar but Rails converts objects with numeric indexes into hashes whereas PHP makes them arrays. Also, some other languages seem to not like the [] to declare arrays.. For regular hashes though they pretty much all work the same.

I recently wrote a Prototype version of this same thing that was designed primarily with PHP in mind since other languages seem to have more limited decoding schemes. It supports any combination of nested arrays and hashes when used with PHP and nested hashes at least with all other languages AFAIK. An important difference between ued_encode and mine is I use Prototype&#039;s Hash methods rather than for.. in loops which is a necessity if you are using Prototype-extended hashes but creates a problem if you use keys named after any of prototype&#039;s Enumerable methods (each, findAll, collect, etc..)
Test page: http://colin.mollenhour.com/posttest.php
Code: http://pastie.caboo.se/47059

Given the major differences in server-side languages&#039; decoding behavior I think that any complex data structures are better encoded as JSON rather than a query string.</description>
		<content:encoded><![CDATA[<p>@Dean: This encoding is also useful for the post body which doesn&#8217;t have a limit and is properly encoded by PHP into the $_POST variable.</p>
<p>@Eric: They are similar but Rails converts objects with numeric indexes into hashes whereas PHP makes them arrays. Also, some other languages seem to not like the [] to declare arrays.. For regular hashes though they pretty much all work the same.</p>
<p>I recently wrote a Prototype version of this same thing that was designed primarily with PHP in mind since other languages seem to have more limited decoding schemes. It supports any combination of nested arrays and hashes when used with PHP and nested hashes at least with all other languages AFAIK. An important difference between ued_encode and mine is I use Prototype&#8217;s Hash methods rather than for.. in loops which is a necessity if you are using Prototype-extended hashes but creates a problem if you use keys named after any of prototype&#8217;s Enumerable methods (each, findAll, collect, etc..)<br />
Test page: <a href="http://colin.mollenhour.com/posttest.php" rel="nofollow">http://colin.mollenhour.com/posttest.php</a><br />
Code: <a href="http://pastie.caboo.se/47059" rel="nofollow">http://pastie.caboo.se/47059</a></p>
<p>Given the major differences in server-side languages&#8217; decoding behavior I think that any complex data structures are better encoded as JSON rather than a query string.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikael bergkvist</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248212</link>
		<dc:creator>mikael bergkvist</dc:creator>
		<pubDate>Thu, 15 Mar 2007 17:04:53 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248212</guid>
		<description>Using xin that would be something like this:
myadress.asp?setData(&#039;name&#039;:&quot;Binny&quot;, &#039;year&#039;:2007, &#039;quote&#039;:&quot;Hello,World!&quot;,&#039;os&#039;:[&#039;Windows&#039;,&#039;Linux&#039;,&#039;Mac&#039;],&#039;software&#039;:{ &#039;editor&#039;:&quot;vi&quot;,&#039;audio&#039;:&quot;xmms&quot;,&#039;video&#039;:&quot;vlc&quot;});</description>
		<content:encoded><![CDATA[<p>Using xin that would be something like this:<br />
myadress.asp?setData(&#8216;name&#8217;:&#8221;Binny&#8221;, &#8216;year&#8217;:2007, &#8216;quote&#8217;:&#8221;Hello,World!&#8221;,&#8217;os&#8217;:['Windows','Linux','Mac'],&#8217;software&#8217;:{ &#8216;editor&#8217;:&#8221;vi&#8221;,&#8217;audio&#8217;:&#8221;xmms&#8221;,&#8217;video&#8217;:&#8221;vlc&#8221;});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Anderson</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248211</link>
		<dc:creator>Eric Anderson</dc:creator>
		<pubDate>Thu, 15 Mar 2007 16:01:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248211</guid>
		<description>I haven&#039;t taken a close look but it appears that format is the same format both PHP and Rails uses (I believe Rails borrowed the idea from PHP).</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t taken a close look but it appears that format is the same format both PHP and Rails uses (I believe Rails borrowed the idea from PHP).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248208</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Thu, 15 Mar 2007 15:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248208</guid>
		<description>I can tell of at least one server-side decoder out of hand.

It&#039;s called PHP. PHP will natively parse such data into variables and arrays. And I&#039;m pretty sure it was written with that in mind.</description>
		<content:encoded><![CDATA[<p>I can tell of at least one server-side decoder out of hand.</p>
<p>It&#8217;s called PHP. PHP will natively parse such data into variables and arrays. And I&#8217;m pretty sure it was written with that in mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maarten</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248206</link>
		<dc:creator>Maarten</dc:creator>
		<pubDate>Thu, 15 Mar 2007 15:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248206</guid>
		<description>Dean; it differs per browser and web server.</description>
		<content:encoded><![CDATA[<p>Dean; it differs per browser and web server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Edwards</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248204</link>
		<dc:creator>Dean Edwards</dc:creator>
		<pubDate>Thu, 15 Mar 2007 15:05:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248204</guid>
		<description>There is a limit on URL length (not sure what it is) so this technique is only good for small packets of data. Still a neat idea, especially if used in conjunction with the Image object.</description>
		<content:encoded><![CDATA[<p>There is a limit on URL length (not sure what it is) so this technique is only good for small packets of data. Still a neat idea, especially if used in conjunction with the Image object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobie Langel</title>
		<link>http://ajaxian.com/archives/ued-url-encoded-data/comment-page-1#comment-248203</link>
		<dc:creator>Tobie Langel</dc:creator>
		<pubDate>Thu, 15 Mar 2007 14:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2216#comment-248203</guid>
		<description>That&#039;s just a basic &lt;a href=&quot;http://prototypejs.org/api/hash/toQueryString&quot; rel=&quot;nofollow&quot;&gt;toQueryString&lt;/a&gt;-like function, right ?

Nice to have a library agnostic version around, though.

We seriously need some sort of standardization for this though, so that back-ends can pick it up more easily.</description>
		<content:encoded><![CDATA[<p>That&#8217;s just a basic <a href="http://prototypejs.org/api/hash/toQueryString" rel="nofollow">toQueryString</a>-like function, right ?</p>
<p>Nice to have a library agnostic version around, though.</p>
<p>We seriously need some sort of standardization for this though, so that back-ends can pick it up more easily.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

