我知道我不是这个新人。但是我需要获取IE 11版中window.location.href的值。它在其他浏览器中可以正常工作。
var loc = window.location.href;
它返回null,因此使用过]
var loc = document.location.href;
它返回主机名而不是完整的URL。
预期:https://stackoverflow.com/questions/ask返回:https://stackoverflow.com
还有其他方法可以获取预期的URL。
Try with below statement:
document.URL;