I would recommend everyone to create a basic HTML tag in development, and then dynamically assign href, so when working with any host that the client uses, it is automatically added to it:
<html> <title>Some page title</titile> <script type="text/javascript"> var head = document.getElementsByTagName('head')[0]; var base = document.createElement("base"); base.href = window.document.location.origin; head.appendChild(base); </script> </head> ...
Therefore, if you are in localhot: 8080, you will get access to all related or link files from the database, for example: http://localhost:8080/some/path/file.html If you are on www.example.com, it will be http://www.example.com/some/path/file.html
Also note that in each location you should not use links such as globs in hrefs, for example: The parent location calls http://localhost:8080/ not http://localhost:8080/some/path/ .
Pretend that you link to all hyperlinks as complete sentences without a base URL.
cagcak Feb 03 '18 at 12:08 2018-02-03 12:08
source share