1.承载Silverlight的页面中的Object添加参数:
<param name="enableHtmlAccess" value="true"/>
以允许Silverlight访问当前页DOM;
2.Silverlight项目中Properties/AppManifest.xml增加参数,作如下修改:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ExternalCallersFromCrossDomain="ScriptableOnly">
<Deployment.Parts>
</Deployment.Parts>
</Deployment>
以允许跨域脚本访问Silverlight中注册并设置为ScriptableMember的对象或方法,
ExternalCallersFromCrossDomain的默认值为NoAccess,即不允许跨域脚本访问。