How to view or modify the absolute path of html

See with Node.prototype.baseURI, modified with the <base>;

document.baseURI; // https://www.cnblogs.com/aisowe
// <base href="https://www.google.com/" />
// <a href="/test.html"> test </a>

document.querySelector('a').baseURI; // https://www.google.com/

 

If you can not get, null is returned.

 

Guess you like

Origin www.cnblogs.com/aisowe/p/11504526.html