[英]Javascript not working in edge, but fine in Firefox, Chrome
I wrote a JavaScript function to get the current logged in user from any page on our SharePoint site and add it to a redirect call so I can make apps that only logged in SP users can access.我编写了一个 JavaScript 函数,用于从我们 SharePoint 网站上的任何页面获取当前登录的用户,并将其添加到重定向调用中,这样我就可以制作只有登录的 SP 用户才能访问的应用程序。
<script>
function init(){
var divv = document.getElementById('SuiteNavUserName').innerHTML;
var UN;
UN = "http://subsite.comapny.org/application/from_sharepoint.aspx?usr=" + divv;
window.location = UN;
}
t = setTimeout("init()",3000);
</script>
Unfortunately, edge never redirects.不幸的是,edge 从不重定向。 Any idea what Edge does not like about my script?
知道 Edge 不喜欢我的脚本吗? I'd test it, but the PC I'm on is running win 7 and thus no Edge to play with.
我会测试它,但我使用的 PC 运行的是 win 7,因此没有 Edge 可以玩。
将 .href 添加到 window.location 得到:window.location.href
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.