We have a client that have their systems set up so that the Javascript in a Content Editor on a page does not seem to run unless they add the url of the site to the list of Trusted Sites in Internet Explorer. Here is the java script:
<script type="text/javascript">
// Copyright (c) 2010 Christophe Humbert - Path to SharePoint
// Find all Web Parts in the page
var listWP=[],calWP=[],divs=document.getElementById("MSO_ContentTable").getElementsByTagName("div");
var count=divs.length;
for (i=0;i<count;i++) {
try {
if (divs[i].id.indexOf("WebPartWPQ")==0){
if (divs[i].innerHTML.indexOf("ViewDefault_CalendarView")>=0) {
// Calendars
calWP.push(divs[i].id);
}
else {
// Other Web Parts
listWP.push(divs[i].id);
}
}
}
catch(e){}
}
function TextToHTML(NodeSet, HTMLregexp) {
var CellContent = "";
var i=0;
while (i < NodeSet.length){
try {
CellContent = NodeSet[i].innerText || NodeSet[i].textContent;
if (HTMLregexp.test(CellContent)) {NodeSet[i].innerHTML = CellContent;}
}
catch(err){}
i=i+1;
}
}
var regexpA = new RegExp("\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");
var regexpTD = new RegExp("^\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");
var WP = new Object;
function UpdateWP() {
if (calWP.length>0){
for (i=0;i<calWP.length;i++) {
WP=document.getElementById(calWP[i]);
if (WP.innerHTML.indexOf("<\;")>=0) {TextToHTML(WP.getElementsByTagName("a"),regexpA);}
}
}
if (listWP.length>0){
for (i=0;i<listWP.length;i++) {
WP=document.getElementById(listWP[i]);
if (WP.innerHTML.indexOf("<\;")>=0) {TextToHTML(WP.getElementsByTagName("td"),regexpTD);}
}
}
// Check every 200 ms, forever
setTimeout("UpdateWP()",200);
}
UpdateWP();
</script>
<script type="text/javascript">
var currheight = document.documentElement.clientHeight;window.onresize = function()
{
if(currheight != document.documentElement.clientHeight)
{
location.replace(location.href);
}
}
</script>
<style type="text/css">
.ms-acal-mdiv
{
margin:0px !important;
padding:0px !important;
height:auto !important;
.ms-acal-item
{
background:none;
border:0;
}
.ms-acal-time
{
display:none;
}
.ms-acal-sdiv
{
position:relative;
width:100%;
}
.ms-acal-sdiv a
{
position:absolute;
left:0px;
width:100%;
}
.ms-acal-sdiv .ms-acal-title
{
padding-top:0px;
height:35px;
}
</style>
Can anyone point me in the direction of why this script won't run while other script runs just fine on their browsers.
TIA