0

I'm using summernote with video plugin and would like to wrap the video iframe with a custom div. It is possible?

There is a method to detect when a content is inserted?

marcelo2605
  • 2,734
  • 4
  • 29
  • 55

1 Answers1

0

Check out this SO answer: jQuery/JavaScript: accessing contents of an iframe

In summary,

  1. The contents of the iframe must be from the same domain as your website, or you will be limited due to the same origin policy.
  2. If you have jQuery, you can access the contents of an iframe like so (where iframeid is the id property of the iframe element:

    $("#iframeid").contents().find("#someDiv")

  3. If you don't have jQuery, you can try:

    myiframe.contentWindow.document

    where myiframe is the target iframe DOM element.

Addendum: You may want to check if the iframe has loaded. With jQuery:

$("#iframeid").ready(function () {
  //Do stuff in here
});
Community
  • 1
  • 1
heartyporridge
  • 1,151
  • 8
  • 25