How do I call a javascript function once a silverlight control has finished loading?

余生长醉 提交于 2019-12-13 18:19:13

问题


I need a silverlight xap to notify the page somehow once it's finished loading. I was trying to use Javascript to call into the control via $(document).ready(...) but it looks like ActiveX controls can continue loading after the document ready event fires. Is there an event on the object tag I can have call a function?


回答1:


you need to provide the Plugin with an onload param that contains the name of function to execute once the application has loaded.

Html:-

<object ....>
  <param name="onload" value="onsilverlightload" />
  ...
</object>

Javascript:-

function onsilverlightload(sender, eventargs)
{
   var pluginElem = sender.getHost();
   //Do stuff.
}


来源:https://stackoverflow.com/questions/3452604/how-do-i-call-a-javascript-function-once-a-silverlight-control-has-finished-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!