Reputation: 3582
i use javascript to judge a page is in a iframe:
if (this != top) { alert("true"); }
but i get "true" all the time,even if not in a iframe(as up picture),who can help me?
Upvotes: 0
Views: 224
Reputation: 14477
Try
if (self != top) { alert("true"); }
Upvotes: 4