Home >Web Front-end >JS Tutorial >Rewriting window.location and determining whether location has been rewritten_javascript skills

Rewriting window.location and determining whether location has been rewritten_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:37:181733browse

Window.lcoation can be rewritten without redirection under IE. The specific method is: var location = {}, and then the specific attributes can be rewritten. This will bring certain risks to determine the location through js.
How to determine whether location has been rewritten? After struggling all afternoon, I came up with a method:

(location==document.location&&location instanceof Location)

This method is only used for IE.

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