Skip to content

Commit 3a5e6ee

Browse files
Merge pull request #29 from AzharAli-github/main
BOM
2 parents c383961 + 7e880fe commit 3a5e6ee

File tree

11 files changed

+51
-0
lines changed

11 files changed

+51
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4.15 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>location-BOM</title>
9+
<link rel="shortcut icon" href="images/js-logo.png" type="image/x-icon">
10+
<link rel="stylesheet" href="style.css">
11+
</head>
12+
13+
<body>
14+
<h1>BOM Location In JS</h1>
15+
<button onclick="Display()">Click to View your current file Location</button>
16+
<div id="textOne">
17+
18+
</div>
19+
<script src="script.js"></script>
20+
</body>
21+
22+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
let textOne = document.getElementById('textOne');
2+
3+
function Display() {
4+
textOne.innerHTML = `
5+
<p>Window Location: ${window.location}</p>
6+
<p>Window Location Href: ${window.location.href}</p>
7+
<p>Window Location HostName: ${window.location.hostname}</p>
8+
<p>Window Location Path Name: ${window.location.pathname}</p>
9+
<p>Window Location Protocol: ${window.location.protocol}</p>
10+
<p>Refresh thr page....</p>
11+
`
12+
}

0 commit comments

Comments
 (0)