is there a way to know the url of a page using javascript code example Example: javascript get current url var currentUrl = window.location.href;