I need the script to dynamically change how it functions if the page is embedded via an iFrame.
The script will be called in the iFrame source from a <script..
tag and wont be inline javascript.
Thank You in Advance!
Update: David provided this answer which works in Firefox and Chrome but doesn't work in IE8, any help with this is appreciated : )
if (window !== top) {
alert('im in an frame');
}
Update2: Apparently this is a duplicate question, the right answer is:
if (top === self) { alert('parent'); } else { alert('iframe'); }
Credit goes to Greg