Postgresql Iterate Over Array Javascript Append To Div