First of all, let’s understand the differences and connections between window.location.href, location.href, self.location.href, parent.location.href, and top.location.href. Simply put: several location.href The difference is that js implements the function of web pages being framed by iframe
"window.location.href", "location.href", "self.location.href" are the jumps to this page
"parent.location.href" is the above One-level page jump
"top.location.href" is the outermost page jump
Give an example (as shown above):
If A, B, C, and D are all It is an ordinary page, D is the iframe of C, C is the iframe of B, and B is the iframe of A.
If the js in D is written like this:
"window.location.href", "location.href": D Page jump
"parent.location.href": C page jump
"top.location.href": A page jump
If there is a form in page D: