Implement profile link in existing Javascript