I created an iframe with regular javascript. In that iframe is the Jquery function along with JQuery. The code works in the iframe as one would expect. I want to have the parent page do the function and not within the iframe. The iFrame and all content is loaded from the same domain, although the code that creates the iframe can be ran on any site. For example, if siteB, siteA ran the code, siteA & B can create the iframe to siteZ's website content.
Here's the code so far from the iframe that I want to run in the parent page:
<script>
$(document).ready(function(){
$().intad({
title: "blahblah",
url: "http://www.blah.com",
timeout: 30,
deplay: 2,
wait: 3,
closeable: true
});
});
</script>
I tried this from the iframe:
<script>
$(document).ready(function(){
function intad(){
title: "blahblah",
url: "http://www.blah.com",
timeout: 30,
deplay: 2,
wait: 3,
closeable: true
});
});
</script>
And this from the code that is loaded into the parent page:
<script>
parent.document.getElementById("RandomIdHere").contentWindow.intads();
</script>