I've such problem. I need to open iframe in fancybox (I need iframe because of I need to browse through links in opened document and stay in fancybox), but I want to put content into iframe from variable, not through src attribute (I've already got content by AJAX (I need to do some checks on content before put it to iframe, so there are no way to do it instead of AJAX query), so I do not need one more query).
Fancybox do not allow to use 'content' attribute with 'type':'iframe'. So i decided to create iframe dynamically, insert my content into it, and show iframe by fancybox as a regular block.
It's like
jQuery('<iframe id="someId"/>').appendTo('body').contents().find('body').append(content);
And than
jQuery('<iframe id="someId"/>').fancybox();
But the first part do not work. I can see the iframe that was added to page but without any content (I have full html page in variable content, but when I try to append just some text it don't work as well).
What I've done wrong? Maybe there are another way to do what I need?
Thanks for your advise!