<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - nomada</title>
<link>http://snipplr.com/users/nomada</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 19 May 2013 20:17:42 GMT</pubDate>
<item>
<title>(JavaScript) Array to SELECT</title>
<link>http://snipplr.com/view/45947/array-to-select/</link>
<description><![CDATA[ <p>This function automates the creation of the s of a  element. It's ideal for your AJAX apps when you create display elements using Javascript

It accepts to different kind of arrays:

An array of key:values…

var arrDirs = {
				"a1":"Sede central",
				"a2":"Envíos",
				"a4":"Facturación",
				"b1":"Sucursal"
			};


An array of arrays, where each of the child arrays have the sintax 'ID': value, 'LABEL': text…

var arrDirs = {
				"0":{"ID":"a1","LABEL":"Sede central"},
				"1":{"ID":"a2","LABEL":"Envíos"},
				"2":{"ID":"a4","LABEL":"Facturación"},
				"3":{"ID":"b1","LABEL":"Sucursal"}
			};

Note that the ID part can be a number or an string.</p> ]]></description>
<pubDate>Mon, 20 Dec 2010 05:39:13 GMT</pubDate>
<guid>http://snipplr.com/view/45947/array-to-select/</guid>
</item>
</channel>
</rss>