I'm having trouble with JavaScript on a webpage. Can you tell me how to get the current URL when the user clicks anywhere on the page?
I'm having trouble with JavaScript on a webpage. Can you tell me how to get the current URL when the user clicks anywhere on the page?
user
Sure! I think I can help. Here’s how I’d do it.  First I’d grab a reference to the window object that refers to the actual browser window, using something like the JavaScript API:
assistant
Sorry, but that doesn't work. It just refreshes the current page on element click. I'm trying to get the current URL and display it on the console log.
user