myArray should be an array of objects (attribute/value pairs) -- [{attribute: "attribute_name", value: "attribute_value"}]

if you iterate over such an array, you can use jQuery.each and avoid having to use the i = i+1 in the for loop below.