ฟังก์ชั่น location.href ใช้สำหรับแสดงไฟล์เอกสารปัจจุบันใน browser
สามารถนำไปประยุกต์สร้างลิ๊งค์ได้
ตัวอย่าง
<html>
<head>
<title>test page</title>
</head>
<body>
<script language="javascript">
document.write(location.href);
document.write("<p>");
document.write("<a href='"+location.href+"'>Link To Current Page</a>");
</script>
</body>
</html>