我写了一个小部件,其中包含来自一个站点的 javascript,另一个站点。代码是:
<script type="text/javascript" src="http://www.easionline.com/min/?f=widget.js"></script>
在 IE9 中,一切都显示完美,但在 IE8 中,我收到此错误:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2;
.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
InfoPath.2)
Timestamp: Fri, 13 Jul 2012 07:20:30 UTC
Message: Access is denied.
Line: 7
Char: 73
Code: 0
URI: http://www.easionline.com/min/?f=widget.js
有人知道为什么 IE8 会给我一个消息被拒绝的问题吗?如果您想查看实现小部件的站点,请访问http://www.ham.co.za
如果您在没有缩小的情况下执行它:
<script type="text/javascript" src="http://www.easionline.com/widget.js"></script>
我收到此错误:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2;
.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
InfoPath.2)
Timestamp: Fri, 13 Jul 2012 07:49:41 UTC
Message: Access is denied.
Line: 98
Char: 3
Code: 0
URI: http://www.easionline.com/widget.js
与错误一致说:
96: var ajaxUrl = site_root+"ajax/widget/"+affid+"/"+category+"/"+numproducts;
97:
98: obj.open("GET",ajaxUrl,true);
99: obj.send(null);
请注意,由于各种原因,我避免使用 Jquery 来完成这项任务。所以问题真的归结为:为什么这个 ajax 调用在 IE9 中有效,但在 IE8 中无效?