Skip to content

Commit dc4c012

Browse files
committed
added the hash tag
1 parent 90a16a7 commit dc4c012

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/detect.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<script type="text/javascript" src="face.js"></script>
1414
<script type="text/javascript">
1515

16+
window.onload = function () {
17+
var url = window.location.hash.substr(1);
18+
if (url.length > 7)
19+
document.getElementById("image").value = decodeURIComponent(url);
20+
}
21+
1622
function resizeCanvas(image, canvas) {
1723
document.body.appendChild(image);
1824
canvas.width = image.offsetWidth;
@@ -40,6 +46,7 @@
4046
function detect() {
4147
var image = new Image();
4248
var url = document.getElementById("image").value;
49+
window.location.hash = "#" + encodeURIComponent(url);
4350
image.src = "loader.php?src=" + encodeURIComponent((url.substr(0, 7).toLowerCase() == "http://") ? url : "http://" + url);
4451
var canvas = document.getElementById("output");
4552
var ctx = canvas.getContext("2d");

0 commit comments

Comments
 (0)