# IM Presence Icons not appearing in SOME master pages - IE9

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
-
Do you have the icons completely disappeared as if presence functionality is switched off, or do you have a gap in the place where the icon should appear? –  Andrey Markeev Jan 23 '12 at 19:53
They are completely gone as if it is switched off. Incidentally, if I switch the X-UA-Compatible switch back to "IE=8" the IM buttons reappear, but all my great-looking CSS styles go away. –  Matt Jan 23 '12 at 20:37
FYI adding an event to a calendar was another problem with IE9. Hopefully they have addressed this issue. –  Heather Waterman Apr 7 '12 at 11:44
Heather, I have resolved this issue on my site as well. Please check this question for a solution: sharepoint.stackexchange.com/questions/31506/… –  Matt Apr 8 '12 at 0:31

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.

-
Thanks for sharing your solution, Matt! It will certainly come handy without debugging myself in my next project. Also note that your change might break IE 7/8 (I'm not sure if they both support "getAttribute"). –  Sig Weber Jan 24 '12 at 17:02
I suppose it might. That is good to keep in mind! Fortunately, for me, it is for an intranet site so I don't have to worry about it. Everybody on the network uses IE9! –  Matt Jan 24 '12 at 17:08

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).

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.

-
Sig, Thanks for this, it totally pointed me in the right direction! –  Matt Jan 24 '12 at 16:31
You know, I really hope there aren't too terribly many things like this! –  Matt Jan 24 '12 at 16:45
@Matt: make sure to test creating/editing items within dialogs. I've seen at least one report that the "Save" button does not work anymore. –  Sig Weber Jan 24 '12 at 17:14
No problems, here. I already had a little bit of javascript in place, though, to remove styles and such from popups for our branding efforts, so maybe that was enough to keep it chugging along. –  Matt Jan 24 '12 at 17:18