首页 > 语言 > JavaScript > 正文

获取当前网页document.url location.href区别总结

2024-05-06 14:18:06
字体:
来源:转载
供稿:网友
JAVASCRIPT權威指南第四版上說,這兩個有區別。
參見 document.URL 章節。
[document.URL是訪問的文檔URL,而window.location.href是真實的文檔URL
搞不明白。
服务器重定向后有可能使document.url变动,但window.location.href指的永远是访问该网页时用的URL.
document.url只能作为只读字符串
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选