javascript - what does this one-liner JS do for 960.gs index page? -


i trying adopt 960.gs (the 960 css grid system) next html+ajax project.

and best started checking implementation of 960.gs index page.

after inspecting elements on page noticed following one-liner in head section:

consider following snippet:

<script type="text/javascript" src="...."></script> <script> this.top.location !== this.location && (this.top.location = this.location); </script> <link rel="stylesheet" href="...." > 

i not pro javascript programmer, looks weird me...

it makes sure site not loaded in iframe.

when site loaded in iframe, this.top refer outer window. outer window's location compared location of iframe, , outer page redirected site.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -