view previous comments javascript function added for user profiles