01-09-2010

Javascript Detect in what frame a script is executed.

The following code checks whether we are in a frame and also makes sure the code get's exectued only if the frame is the second frame in the parents frameset:

if (top !== self && this.window === parent.frames[1]){
	alert ('i am in the second frame');
}
 

Comments:

Your comment:

»

 

[x]