Skip to content

Commit 0001bd8

Browse files
committed
Fix images not found?
1 parent fe28b23 commit 0001bd8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ <h1>The Toy Pad</h1>
736736

737737
var content = "<h3>" + itemData.name + "</h3>";
738738
var path = "images/" + itemData.id + ".png";
739-
var url = $(location).attr("origin") + "/server/" + path;
739+
var url = $(location).attr("href") + "/../" + path;
740740
if (fileExists(url)) {
741741
content = "<img src=" + path + " alt=" + itemData.name + " style='width: 100%; height: 100%; object-fit: contain; pointer-events: none;'>";
742742
}
@@ -746,7 +746,6 @@ <h1>The Toy Pad</h1>
746746
}
747747

748748
function fileExists(url) {
749-
console.log(url);
750749
var http = new XMLHttpRequest();
751750
http.open('HEAD', url, false);
752751
http.send();

0 commit comments

Comments
 (0)