html - Accessing a javascript function placed in IFrame from parent Silverlight -
i have got silverlight app placed in html page. silverlight object has id. create new iframe calling code
htmlelement plugin_div = htmlpage.plugin.parent, new_div = htmlpage.document.createelement("div"), iframe = htmlpage.document.createelement("iframe");
then set placement paramenters.
i set source attribute of iframe page laying in same (.web) location:
iframe.setattribute("src", "/viewer.htm");
the viewer.htm page consists of js functions.
i access silverlight functions due id this:
var slobject = parent.document.getelementbyid("id"); slobject.content.page.callmyfunction();
the question how call children function of iframe (of viewer.htm page). tried code, doesn't work:
htmlpage.document.getelementbyid("vieweriframeid").invoke(myfunction);
or
htmlpage.document.getelementbyid("vieweriframeid").children.invoke(myfunction);
but nothing work.
please me.
just use iframe id
example if id
of iframe
myiframe
, function myfunction
can call function using javascript
:
myiframe.myfunction();
Comments
Post a Comment