Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何在 JavaScript 中获取从命令行传递的 hostUrl
在 Java 中,可以键入 System.getProperty("hostUrl"); 为达到这个。JavaScript中有什么替代方法?
我假设您正在搜索window.location.hostnameor window.location.host。
window.location.hostname
window.location.host