您的位置:首页 > 其它

关于silverlight3程序在win7 ie8环境下运行出现跨域的错误

2010-09-14 11:25 309 查看
silverlight3程序在win7 ie8环境下运行出现跨域的错误,但在其他系统(都不是ie8)下面访问一点问题都没有,之前我一直往跨域的方向去想解决方案,但无论怎么样都没有用,肯定不是跨域的问题了,偶然间,我试了下下面程序

double screenWidth = (double)HtmlPage.Window.Eval("screen.width");
double screenHeight = (double)HtmlPage.Window.Eval("screen.height");

if (screenWidth >= 1280)
{
this.RootVisual = new index3();
}
else
{
this.RootVisual = new index2();
}


我将 double screenWidth = (double)HtmlPage.Window.Eval("screen.Width");
double screenHeight = (double)HtmlPage.Window.Eval("screen.Height");

if (screenWidth >= 1280)
{
this.RootVisual = new index3();
}
else
{

}去掉,单独访问index2,没问题,再去掉index3,单独访问index2也没问题,于是我想应该是

double screenWidth = (double)HtmlPage.Window.Eval("screen.Width");
double screenHeight = (double)HtmlPage.Window.Eval("screen.Height");

的错误了,搜了下资料,原来silverlight查找客户端的屏幕分辨率是通过js去访问的,js是区分大小写的,

终于明白了,原来就是screen.Height出问题,screen.Height改成screen.height就没问题了。

但一直想不明白,为什么单独在win7+ie8下环境出错,而且还出跨域问题的错误?不知道微软怎么搞的?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐