What's the difference between self and window?

后端 未结 4 567
夕颜
夕颜 2020-11-29 09:20

I have a JavaScript that deals with with detection whether the page is in frames or not. I used top.frames[] etc. and everything works fine.

In this script I notice

4条回答
  •  野性不改
    2020-11-29 09:43

    window and self both refer to the global object of the current web page.

    For more info have a look at http://www.howtocreate.co.uk/tutorials/javascript/browserinspecific

提交回复
热议问题