“Ubicación de la ventana” Código de respuesta

JavaScript obtenga URL actual

var currentUrl = window.location.href;
Grepper

Window.Ref

//its actually 
window.location.href = "/App/Home"
//or
window.location.href = "https://www.google.com/"
Confused Penguin

ventana. Ubicación

window.location.href = link;
// or
window.location.assign(link);
Inquisitive Iguana

Ubicación de la ventana

document.getElementById("demo").innerHTML = 
"The full URL of this page is:<br>" + window.location.href;
//Result
//The full URL of this page is: https://www.w3schools.com/js/tryit.asp?filename=tryjs_loc_href

document.getElementById("demo").innerHTML =
"Page hostname is " + window.location.hostname;
//Result
//Page hostname is www.w3schools.com

document.getElementById("demo").innerHTML =
"Page path is " + window.location.pathname;
//Result
//Page path is /js/js_window_location.asp
Shadow

Ubicación de la ventana JavaScript

document.getElementById("demo").innerHTML =
"Page location is " + window.location.href;
naly moslih

Respuestas similares a “Ubicación de la ventana”

Preguntas similares a “Ubicación de la ventana”

Más respuestas relacionadas con “Ubicación de la ventana” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código