JQuery Check if Window is in iFrame

Simple JavaScript code snippet to check whether or not a window is in an iFrame.
Very useful for some functions that may make use of the URL in the address bar of the page.

var isInIframe = (window.location != window.parent.location) ? true : false;
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

No Responses to “JQuery Check if Window is in iFrame”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>