Can't change iFrame properties via the "onMessage" function

45 views
Skip to first unread message

West

unread,
May 22, 2012, 3:34:37 PM5/22/12
to easyxdm
Hi,

I'm new to using easyXDM and trying to load this iframe that is on a
different domain. The iframe is displaying, but I can't change any of
the properties of the iframe for some reason. The content does show,
but I set scrolling to "no" and I still see scroll bars. It's as if
the onMessage function isn't getting called. I tried putting an
alert() in there also and it does NOT execute.

Any idea why?

Here is my code:

<script type="text/javascript">

var transport = new easyXDM.Socket({
remote: "http://iframe.contentabc.com/",
container: "embedded",
onMessage: function(message, origin){
this.container.getElementsByTagName("iframe")
[0].style.height = Number(message) + "px";
this.container.getElementsByTagName("iframe")
[0].style.width = "990px";
this.container.getElementsByTagName("iframe")
[0].scrolling="no";
this.container.getElementsByTagName("iframe")
[0].frameborder = 0;
}
});

</script>

<div id="embedded" style="overflow:hidden; margin:0px; padding:0px;"></
div>

Øyvind Sean Kinsey

unread,
May 23, 2012, 6:45:46 AM5/23/12
to eas...@googlegroups.com
Your example shows nothing about the code running inside the iframe, the code that is sending the message that onMessage would receive.
Reply all
Reply to author
Forward
0 new messages