top.location与this.location

top.location! = this.location means that the url of the current form is different from the url of the parent form (url mainly refers to whether it is the same domain)

The usual usage is:

if(top.location != this.location){

    top.location=this.location;

}

This is mainly to prevent other websites from embedding your website (such as embedding other websites with iframe)




H-L
Published 8 original articles · Likes5 · Visits 40,000+

Guess you like

Origin blog.csdn.net/helenwei2017/article/details/80048459