js to realize the friendlink function