Get and Post in JavaScript

I want to get variables from a URL and write it to an href, for example:

URL:

http://www.xyz1.com/?sk=app_190322544333196&utm_source=google&utm_medium=cpc&utm_content=18-24-ALL-AD3&utm_campaign=FP-IT

HREF:

http://www.xyz2.com/?sk=app_190322544333196&utm_source=google&utm_medium=cpc&utm_content=18-24-ALL-AD3&utm_campaign=FP-IT

How’s that possible using only Javascript?


document.getElementById('identifierOfLink').href = window.location.href;