Fetch JSON data From Url Hash to represent as a note on the screen

When I use a URL like domain.tld/index.html/IPFSHASH it should fetch the JSON and use its data to represent as a note on the screen. How can i do it without any nodejs, using only just vanilla js.
when try to use location.hostname from url like domain.tld/index.html/IPFSHASH then it redirects to another page, but i want to load it in the current page and it shows ERR_FILE_NOT_FOUND