“Lokasi JavaScript.href” Kode Jawaban

Lokasi JavaScript Onclick HREF

onclick="location.href='unit_01.htm'"
Bored Beaver

window.href

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

Lokasi Jendela Setiap Web

var url = new URL("http://aaa.bbb.ccc.com/asdf/asdf/sadf.aspx?blah");
console.log(url.protocol);  // "http:"
console.log(url.hostname);  // "aaa.bbb.ccc.com"
console.log(url.pathname);  // "/asdf/asdf/sadf.aspx"
console.log(url.search);  
Antoniotonio

Lokasi JavaScript.href

//example 1
document.getElementById("lbl_url").innerHTML = "Page location is " + window.location.href;
//example 2
var x = location.href;
Ivan The Terrible

Jawaban yang mirip dengan “Lokasi JavaScript.href”

Pertanyaan yang mirip dengan “Lokasi JavaScript.href”

Lebih banyak jawaban terkait untuk “Lokasi JavaScript.href” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya