All I want is to get the website URL. Not the URL as taken from a link. On the page loading I need to be able to grab the full, current URL of the website and set it as a variable to do with as I please.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Open Developer Tools, type in the following in the console and press Enter.
Ex: Below is the screenshot of the result on the current page.
Grab what you need from here. :)
Use:
window.location.href
.As noted above,
document.URL
doesn't update when updatingwindow.location
. See MDN.