How to detect presence of FB?

Page: 1

Author Post
flyingpylon
Guest
I'm using FB to load an html page in an iframe. What would be the best way to have that html page determine whether it's in a floatboxed iframe, and if not, then stop working?

Basically, I want to make sure that my page is getting loaded in the context of my site and people are not just going directly to the url. The contents of the page is being loaded by javascript, so I'm hoping there is some easy way to say "if not in a floatbox, don't load the content".
Administrator
Registered: Aug 2008
Posts: 3382
For your purposes, it's probably good enough just to determine if any floatbox is loaded on your page. The following would accomplish this:
if (top.fb && top.fb.fbContent) ...
flyingpylon
Guest
Works great... thanks!

Page: 1