how to get the current url in javascript and take a header code example Example: current url window.location.href