I currently have the following JavaScript function that will take current URL and concatenate it to another site URL to …