Insert iframe in Modal


#1

I have a few social media icons within a slidebox. When you click each corresponding social media icon, a modal with an iframe should appear or use the in app browser from cordova. how can I insert this iframe and would you recommend iframe or in app browser. I want to be able to position the in-app browser under the header and also include a close icon which is why i prefer inserting an iframe within a modal that I have set to 100% width and height and position 44px top. Right now I am getting a warning Refused to display ‘https://www.facebook.com/PerryEllis&output=embed’ in a frame because it set ‘X-Frame-Options’ to ‘DENY’.


#2

This is because facebook doesn’t allow their content to be visible through iFrames. Its a known thing and unfortunately cannot be done.


#3

can you explain another option? can i open up this brand page in facebook application? using a simple a href does not work either.

thanks again,
Katherine


#4

Hmm, the only other option I can think of is to open it in cordova’s inappbrowser window. That will open the page in a new window, similar to twitter when you click on links.

That would probably be the quickest solution and you shouldn’t have any issues

$ cordova plugin add org.apache.cordova.inappbrowser

Then you could set up links following the api guide here.
https://github.com/apache/cordova-plugin-inappbrowser/blob/dev/doc/index.md