I have this weird problem on one of our customer's SharePoint (2010): sometimes, on different pages, the page came out broken, with a bunch of HTML and scripts inside the normal page. I started checking the two HTML of the same page (the broken one and the good one) and only a little detail is different: this Javascript line is injected randomly inside the header or the body of some web part, totally brooking HTML, scripts and most of the interactions:
"); f.innerHTML = unescape(child.innerHTML) + ' '; count ++; } } }
I only found this line inside an XSL file that seems something related to preview (vwstyles.xsl), but really can't find why this problem should occur, and can't find any hint on this.
Just for reference, there are two DB servers, two application servers and two fronted servers. The problem seems to only and always occur on fronted servers. To let it disappear, a simple hit on the application server reset the situation and the fronted servers start working again, for a different time frame.
This looks completely weird to me.
This is the complete XSL/Javascript piece that seems to blow up:
<script>
function showpreview<xsl:value-of select="$ViewCounter" />(o) {
count = 1;
for(i = 0; i < o.childNodes.length; i++)
{
var child = o.childNodes[i];
if (child.style.display == "none" && child.tagName == "DIV")
{
f = document.getElementById("n" + count + "<xsl:value-of select="$WPQ" />");
f.innerHTML = unescape(child.innerHTML) + ' ';
count ++;
}
}
}
</script>