View Full Version : what this script does
andrew1234
12-03-2002, 02:35 PM
hi can you please tell me what this script does
thanks
andrew
<SCRIPT language=Javascript1.1 type=text/javascript>
<!--
if (window != top)
top.location.href = window.location.href;
// -->
</SCRIPT>
BrainJar
12-03-2002, 03:09 PM
top is a reserved name that refers to the topmost browser window (such as when frames are being used). window is also a reserved name that refers to the window or frame that the code is loaded in.
So basically, that code says "if the window I'm in is not the topmost window, reload the top window with my URL."
In other words, it's a frame buster. If you try to load a page with that code into some part of a frameset, it will replace the entire frameset with itself.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.