Ok so the code I had tried for this just isn't working right. So basically all i need is to insert the current page url in a link I was using document.location.href with several methods.