简体   繁体   English

Javascript 在 Edge 中不起作用,但在 Firefox、Chrome 中很好

[英]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.

相关问题 JavaScript适用于IE和Edge,但不适用于Chrome和Firefox - JavaScript working on IE and Edge but not working on Chrome and Firefox Web通知无法在chrome上运行,但在Firefox和Microsoft Edge上可以正常运行 - Web notifications is not working on chrome, but it's working fine on firefox and microsoft edge JavaScript 在 Firefox、Chrome 中不起作用 - 在 IE、Edge 中有效 - JavaScript not working in Firefox, Chrome - works in IE, Edge Javascript进度条无法在Chrome中运行,在Firefox中运行良好 - Javascript progress bar not working in Chrome, fine in firefox JavaScript 粘贴事件在 Chrome 但不是 Firefox 中工作正常 - JavaScript paste event working fine in Chrome but not Firefox Javascript Tabifier在Chrome中不起作用,但在Firefox上可以正常工作 - Javascript tabifier not working in Chrome, but works fine on Firefox JavaScript无法在IE和Firefox中运行,在Chrome中运行良好 - JavaScript not working in IE and Firefox, works fine in Chrome Chrome可在Chrome,Opera和Edge上使用Javascript,但在FireFox或IE 11上则无法使用 - Javascript working on Chrome & Opera & Edge, but not on FireFox or IE 11 javascript 中的输入字段样式属性在 chrome 中工作正常,而在 Firefox 中不起作用 - Input field style attribute in javascript works fine in chrome and not working in firefox Javascript / jQuery无法在Firefox,Safari和IE中运行。 精通Opera和Chrome - Javascript/jQuery not working in Firefox, Safari and IE. Fine in Opera and Chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM