I am having lots of issues on a website because my jQuery is causing errors due to the fact that it is being rendered inside of an iFrame. Is there any way I can tell my jQuery not to load when it is inside of an iFrame?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
from @Greg answer
if (top === self) { not in a frame } else { in a frame }top and self are both window objects (along with parent), so you’re seeing if your window is the top window.
Greg answer