I use fancybox to show a popup window from another url, using iframe.
Here is the demo of fancybox: http://fancyapps.com/fancybox/#examples
<a class="various fancybox.iframe" href="http://jquery.com/">Iframe</a>
The demo page is correct, but if I change the url of iframe to this url: http://www.shdog.net/u/space-47012-do-blog-id-21557.html
<a class="various fancybox.iframe" href="http://www.shdog.net/u/space-47012-do-blog-id-21557.html
">Iframe</a>
…it will direct to the new page and doesn’t show a popup window.
Why does this happen?
Because the second site has this js file:
http://www.shdog.net/u/source/script_common.js
and inside that file exist this piece code
which evaluates if the site is being opened inside an
iframe(in this case fancybox)… if so, it moves itself out of theiframeto the main page of the browser.That site and others with such scripts cannot be opened in fancybox (or any other lightbox … or inside of
htmliframes)