【发布时间】:2016-09-22 09:46:02
【问题描述】:
我的 JS:
function redirect(aPath) {
var app = $('#divMain').injector();
if (aPath == app.get('$location').path()) {
app.get('$state').reload();
}
else {
app.get('$location').path(aPath);
}
$('#divMain').scope().$apply();
}
这些情况在 Chrome 中运行良好,但在 IE 中,当我单击同一页面导航链接时,即“if”条件 scope().$apply() 不会触发。我错过了什么吗?
即使在 Chrome 中,平板电脑(iPad)也有相同的场景。
【问题讨论】:
-
您使用的是什么版本的 SharePoint?
-
@Thriggle Sharepoint 2010
-
在这种情况下,SharePoint 可能会强制 Internet Explorer 进入兼容模式,以模拟 IE8。针对 IE8 测试您的 JavaScript 并根据需要使用 polyfill。请注意,您需要明确使用 jQuery 1.12 来支持 IE8;最新版本的 jQuery 仅适用于 IE9+。
标签: javascript jquery angularjs internet-explorer sharepoint