Anda di halaman 1dari 2

Heri Purnama

125410101
Teknologi Web
TI 02
1.
a.Script
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<p>============================================================================<
/p>
<p>Klik tombol OK untuk menampilkan seluruh informasi saat ini.</p>
<button onclick="myFunction()">Klik OK</button>
<p>============================================================================<
/p>
<p id="demo 1"></p>
<P id="demo 2"></P>
<p id="demo 3"></p>
<p id="demo 4"></p>
<p id="demo 5"></p>
<p id="demo 6"></p>
<p>Klik tombol Buka Dokumen Baru untuk membuka halaman baru.</p>
<input type="button" value="Buka Dokumen Baru" onclick="newDoc()"
title="Web Akakom" >
<button onclick="refresh()">Refresh</button>
<script type="text/javascript">
function myFunction () {
// body...
document.getElementById("demo 1").innerHTML =
"screen width/lebar layar : "+ screen.width;
document.getElementById("demo 2").innerHTML =
"screen height/tinggi layar : "+ screen.availHeight;
document.getElementById("demo 3").innerHTML =
"URL halaman saat ini : "+ window.location.href;
document.getElementById("demo 4").innerHTML =
"Nama host internet saat ini :"+ window.location.host;
document.getElementById("demo 5").innerHTML =
"Nama pathname halaman saat ini :"+ window.location.pathname;

document.getElementById("demo 6").innerHTML =
"Nama protocol halaman web saat ini :"+
window.location.protocol;
}
function newDoc() {
window.location.assign("http://www.akakom.ac.id")
}
function refresh(){
location.reload()
}
</script>
<p>============================================================================<
/p>
</body>
</html>

b.Output

Sebelum

Sesudah