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?
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?
Check out this SO answer: jQuery/JavaScript: accessing contents of an iframe
In summary,
iframe
must be from the same domain as your website, or you will be limited due to the same origin policy.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")
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
});