Skip to content

Commit

Permalink
Ending spans is important
Browse files Browse the repository at this point in the history
  • Loading branch information
Citronnelle committed Sep 9, 2019
1 parent db8486a commit 192cf96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions web/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
top: 20%;
left: 20%;
width: 50%;
height: 70%;
text-align: center;
}
12 changes: 6 additions & 6 deletions web/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<link rel="stylesheet" type="text/css" href="style.css">
<script>
var urlStr = window.location.href;
urlStr = urlStr.split("?")[1]; // Will not get the first parameter without the split.
var queryStr = urlStr.split("?")[1]; // Will not get the first parameter without the split.

var searchParams = new URLSearchParams(urlStr);
var searchParams = new URLSearchParams(queryStr);

var prodFileName = searchParams.get("file");
var prodName = searchParams.get("name");
Expand All @@ -22,7 +22,7 @@
document.getElementById("prodName").innerText = prodName;
document.getElementById("prodPrice").innerText = price;

alert(prodName, price, fileName);
alert(prodName + ", " + price + ", " + fileName);
}
</script>
</head>
Expand All @@ -34,9 +34,9 @@
<input class="right" type="button" name="cart" value="Cart">
</header>
<section name="view" class="center">
<img id="prodImage" width="300">
<br /><span id="prodPrice" />
<br /><span id="prodName" />
<img id="prodImage" height="300">
<br /><span id="prodPrice"></span>
<br /><span id="prodName"></span>
</section>
</body>
</html>

0 comments on commit 192cf96

Please sign in to comment.