When a person clicks on a link, I want to do this:
What part isn't working?
Try encodeURI() rather than escape().