Question

I have updated my master pages to use some HTML5 and CSS3 elements. I therefore changed the to use HTML5, and altered the X-UA-COMPATIBLE to work in "IE=9;IE=Edge;" mode (instead of IE8). I did not realize it for a few days after that, but for some reason this causes the presence icons for users to go away, EXCEPT on the search pages. Document Center, Publishing sites, team sites, none of them have working presence icons now, and they used to.

I think there must be some difference between the two types of master page (minimal.master vs v4.master - from Drisgill), but I cannot figure out what it is. The SharePoint compatibility list says it should work perfectly with IE9.

Does anybody have a solution to this, or a similar situation?

Thanks,

  • Matt
Était-ce utile?

La solution

As Sig suggested there are some changes to the way IE9 handles javascript from previous versions.

I found my answer in /_layouts/1031/init.js in the function ProcessImnMarkers() (Ironically, a function you want to overwrite as empty if you actually WANT to hide the IM Presence stuff).

Here is the original code of the function:

function ProcessImnMarkers()
{ULSxSy:;
    for (var i=0; i < imnMarkerBatchSize;++i)
    {
        if (imnCount==imnElemsCount)
            return;
        if (IsSupportedMacBrowser())
            IMNRC(imnElems[imnCount].getAttribute("sip"),imnElems[imnCount]);
        else
            IMNRC(imnElems[imnCount].sip,imnElems[imnCount]);
        imnCount++;
    }
    setTimeout("ProcessImnMarkers()",imnMarkerBatchDelay);
}

THIS is the offending line:

IMNRC(imnElems[imnCount].sip,imnElems[imnCount]);

It turns out the ".sip" in that line is referencing a custom HTML attribute. This worked fine in EVERY other version of IE previously, but they removed that ability in their javascript parser to make it more compatible with the standards. See: DOM Expandos

I have another problem with one of the dynamic menus in SharePoint and I am hoping it is the same kind of issues. It was actually very easy to override the broken method above with my own code:

    // replace IE Function:
    var ProcessImnMarkers = function ()
    {
        ULSxSy:;
        for (var i = 0; i < imnMarkerBatchSize; ++i)
        {
            if(imnCount==imnElemsCount)
            {
                return;
            }
            IMNRC(imnElems[imnCount].getAttribute('sip'),imnElems[imnCount]);
            imnCount++;
        }
        setTimeout("ProcessImnMarkers()", imnMarkerBatchDelay);
    };

Thanks again, Sig! I could not have found the answer here, without your help!

UPDATE I tested this out using the IE Developer tools in IE8, and IE7 modes. Everything seemed to work OK in IE8 Mode, but in IE7 the icons showed up and didn't do anything. Let it be known that if you expect people to use IE7 to view your site, you need to include a workaround for that browser to use the .sip method.

Autres conseils

First, the SharePoint compatibility list says it should work perfectly with IE9, thats correct.

BUT only if you use X-UA-COMPATIBLE with "IE=8;". This is AFAIK the only supported scenario by Microsoft.

Since I'm not working for Microsoft you can get an official statement by opening a support request (and post back their reply here).

So back to your problem...

Switching to X-UA-COMPATIBLE with "IE=9;" (or "IE=Edge;") will cause IE 9 to handle several things different. Some JavaScript functions might not work any longer (I don't know them of the top of my head but you can look them up on MSDN) and the handling of HTML parsing has been changed.

UPDATE: here's a link to get you started on MSDN: http://msdn.microsoft.com/en-us/library/ie/ff986083%28v=vs.85%29.aspx

I suspect the issue arises from HTML parsing changes which causes the function IMNGetOOUILocation (located in layouts\1031\init.js) to fail getting the correct position to display the IM presence pawn (I've seen this happening in the past).

If you have the time and patience you can try to debug it using the IE Developer Tools.

As for the search pages, they do use another masterpage hence it works there.

Sorry for not having a better answer but I currently do not have my developer virtual machine with me to debug it myself.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top