I had a webpage with a link, which opens a new page in a popup window. Everything is fine till here, The popup window contains credit card payment page held by some 3rd part
Google is your friend ;D
var newURL = window.location.protocol + "://" + window.location.host + "/" + window.location.pathname;