I simply want the domain that appears there in the URL to appear on the page.
window.location.hostname
gives me this, it just does not work on Node / Vue.js, so what would be the solution?
I simply want the domain that appears there in the URL to appear on the page.
window.location.hostname
gives me this, it just does not work on Node / Vue.js, so what would be the solution?
I do not understand your question, even because it is not clear enough. But to get the domain you can use a Javascript property that returns the domain of the page.
document.domain
When executing this in the console of so you will have the following return:
"pt.stackoverflow.com"
For more information you can access this documentation by clicking here . p>