Reputation: 19607
I have a page that's been displayed through an iframe as a facebook pagetab. How can I make sure that the page is displayed in an iframe as intended ?
Upvotes: 0
Views: 128
Reputation: 5389
You cannot always ensure that because your users can always fool the browser that it is what you want it to be. But you can try this:
if (window!=window.top) { /* In a frame! */ }
else { /* probably reload page and redirect to the page embedding the iframe */ }
Upvotes: 1
Reputation: 177692
You mean
if (top==self) location.replace("iframewrapper.html?loc="+escape(location.href))
Upvotes: 3