Try this: var i = 0; var s = ''; for (var prop in o) { if (i > 0) s += '&';
s += prop + '=' + o[prop]; ++i; } alert(s); On Aug 24, 5:12 pm, "Josh Rosenthal" <[EMAIL PROTECTED]> wrote: > Hey Folks, > > Probably a rather basic question here, but my attempts at figuring it out > have come to no success. > > I'm using $.each to loop through the attributes of an object, and write them > out into a string. The object contains a series of parameters that will be > passed through a url (for a geoserver WFS should anyone care). Is there any > way to get the name of the attribute so that it can be used as a string? > > Mockup object: > { > request: "getfeature", > typename: "massgis:TOWNS", > propertyname: "TOWN_ID,PARCEL_STATUS", > cql_filter: "INTERSECT(SHAPE,POINT(-72.22%2041.00)" > > } > > Goal is to generate something like.... > &request=getfeature&typename=massGIS:TOWNS&propertyname=.... > > Unfortunately, I can't seem to get 'request' and 'typename' etc. Anything > obvious I'm missing, or is this truly impossible? > > Thanks a lot, > Josh