Home  >  Article  >  Web Front-end  >  Summary of the differences between document.url and location.href of the current web page_javascript skills

Summary of the differences between document.url and location.href of the current web page_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:04:591356browse

The Fourth Edition of the Definitive Guide to JAVASCRIPT says that there is a difference between the two.
See document.URL section.
[document.URL is the accessed document URL, and window.location.href is the real document URL
I don’t understand.
Document.url may change after server redirection, but window.location.href always refers to the URL used to access the web page.
document.url can only be used as a read-only string

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn