23-08-2010

Javascript check for frames

You can easily check whether the page you're on is in a frameset by comparing the top and self properties like so:

Works in all major browsers.

if (top !== self){
	alert('frames')
}else{
	alert('no frames')
}

Comments:

Your comment:

»

 

[x]