您现在的位置是:首页 > 电脑技术查询 > web开发

document.URL 和 location.href 有什么区别,该如何处理

编辑:chaxungu时间:2022-10-02 23:22:40分类:web开发

document.URL 和 location.href 有什么区别
实现跳转的功能好像一样的
不过document.URL可以获取当前url

------解决方案--------------------
location.href也可以获取当前的url啊!!

------解决方案--------------------
1.设置或获取当前文档的 URL。
2.设置或获取整个 URL 为字符串。