function alertObj(obj) { var s = new Array(); for (p in obj) { s.push(p +': ' +obj[p] +"\n"); } alert(s.join('')); }