at the moment i try to figure something out regarding the manipulation of content which is loaded in an IFrame using FancyBox.
First my Situation:
I have my main Page index.php with Standard html, css, etc. and no problems there.
Now i have a file edit.php which contains a link
<a class="various" data-fancybox-type="iframe" href="../index.php">Edit</a>
and the jquery Stuff to load the link in the fancybox:
$(".various").fancybox({
padding : 0,
margin : 0,
fitToView : true,
width : '100%',
height : '100%',
autoSize : false,
closeClick : true,
openEffect : 'fade',
closeEffect : 'fade',
});
This works fine.
What i want to do now is to add some JQuery functionality to the page, which is loaded in the iFrame. My idea was to do something like
$(body).append('<script src="functionality.js" type="text/javascript"></script>');
so i can write my events in functionality.js.
But sadly this does not work.
I think the first problem is that i cannot access the body of the loaded page.
I hope someone can help my solve this problem.