Fe-interview: [js] 第202天 如何使用js获取当前的url和来源的url?

Created on 3 Nov 2019  ·  3Comments  ·  Source: haizlin/fe-interview

第202天 如何使用js获取当前的url和来源的url?

js

Most helpful comment

window.location.href
document.referrer

All 3 comments

window.location.href

window.location.href
document.referrer

URL checker

https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer

document.referrer;
// "https://github.com/haizlin/fe-interview/labels/js"

window.location.href;
// "https://github.com/haizlin/fe-interview/issues/1478"

Was this page helpful?
0 / 5 - 0 ratings