The base is dynamically installed in php when building an HTML page:
$base_line = '<base href="' . $some_path . '/" /> '; echo $base_line;
Now that I am on the HTML page, I need to access this information ($ some_path), and after searching for several hours, I do not seem to find the answer. Please note that the loaded HTML page has a URL that is not connected to the database, and I do not have access to the PHP code to change it. There may be a URL on the loaded page: http://xyz.com/index.php , but all other links on the page will be based on the value set by the base, so I cannot get the base using the page URL.
Suppose I could capture one of the elements, such as an image, and analyze it using the DOM to find the base, but there should be an easier way to do this. Any ideas?
Using window.location does not work in this situation, since it will return what is connected with the loaded URL of the page, and not what was set as the base inside it.
javascript html base
Rasul
source share