I give my iFrame code to clients, so they can display the dynamic content from my site. I'd like the iFrame that lives on their page to resize to fit my content. I followed the instructions from the easyXDM site, but maybe I am missing something.
I don't get any errors, but the iFrame stays the default height (150px). The code I give my client site is :
<script src="http://test.pronetis.net/SNM.CMS/js/easyXDM/easyXDM.debug.js" type="text/javascript"></script>
<script type="text/javascript">
var transport = new easyXDM.Socket({
remote: "http://www.lipsum.com/",
container: "container",
onMessage: function (message, origin) {
this.container.getElementsByTagName("iframe")[0].style.height = message + "px";
}
});
</script>
<div id="container"></div>
And this is the code that goes on the document I want to embed :
<script src="http://test.pronetis.net/SNM.CMS/js/easyXDM/easyXDM.debug.js" type="text/javascript"></script>
<script type="text/javascript">
var socket = new easyXDM.Socket({
onReady: function () { socket.postMessage(document.body.scrollHeight) }
});
</script>
I'm hoping there is something simple I'm doing wrong...