added suggestions from js/test.js for ajax call to viewProfile.