I want to check whether the loaded page is loaded directly from browser or called inside any frame including Facebook application as canvas page.
This is really important for me. I found out this question How to identify if a webpage is being loaded inside an iframe or directly into the browser window? but some people said that it doesn't work at some browsers ?
I can also use jquery if that provides better solution or this solution is the best ?
Thank you very much for the answers
function inIframe () {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}