oooops,

yeah, convert it to an object with JSON.decode(string); than my code snippets work. (i should read more carefully next time ;) )

jan

On Oct 21, 2008, at 20:56, Martin Tillmann wrote:

jan beat me to it but i think maybe your problem is rather to make an object from the string. Here's my take:

$ H (JSON .decode ("{'name':'value','name2':'value2'}")).each(function(item,index){
console.log("key= %s, value= %s",index,item);
});

You can use JSON.decode() to make the object from your string (assuming your string is valid JSON) and since this only gives you a plain object i make it a Hash and use each() on it. (you'll need firebug to make the above run!)


On Tue, Oct 21, 2008 at 8:34 PM, TomWA007 <[EMAIL PROTECTED]> wrote:

Is there any way to convert the string  "{name:value,name2:value2}" to
the iterable it looks like so that I can use $each to loop through it?


--
my blog: http://blog.kassens.net

Reply via email to