var obj = {var:"value", othervar:"value"};
var string = '';

for(var i in obj) {
   string += (i + '=' + obj[i] + ',');
}

// the loop leaves a comma dangling at the end of string, chop it off
string = string.substring(0, string.length-1);

On 6/22/07, Alexandre Plennevaux <[EMAIL PROTECTED]> wrote:

 Warning this is a real noobie question. if you don't mind my asking: what
is the simplest way to convert a hash into a string via jquery or javascript
, so that

obj= { var:"value", othervar:"value"} turns into
"var=value,othervar=value" ?

thank you for your time!

Alexandre

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.9.4/860 - Date: 21/06/2007
17:53




--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com

Reply via email to