iFrame or not?

How to detect if our website is opened inside an iFrame?

if ( window != window.top ) { alert("I'm in a frame!"); }