I think this would be better done by showing a text box containing the link (having it initially hidden, and on clicking this link, set its value to this function, and then show). The alert box is not terribly user friendly for copying from.