OCS presence in SharePoint AJAX-based web part

Posted by Maksym Ozerov on Stack Overflow See other posts from Stack Overflow or by Maksym Ozerov
Published on 2010-06-15T08:41:47Z Indexed on 2010/06/15 8:42 UTC
Read the original article Hit count: 514

Filed under:
|
|
|
|

I'm currently implementing AJAX-based web part which displays search result. This search result has user names and opposite to each name I'm rendering the OCS presence indicator. This indicator works fine in IE6 but I can't get it to work in IE7/8.

Basically the problem in IE7/8 is that OCS is rendered but when you mouse over it nothing is shown. If you try to scroll page down then mouse over the OCS icon you will see the OCS actions menu in the bottom of the page instead of seeing it on the opposite to the user name.

My AJAX-based web part uses jQuery post method to make a request to the server and receives json which is then rendered to the div.

My HTML for the user name looks like this:

<nobr>
    <span>
        <a target='_blank' href='/ViewExpert.aspx?uid=4'>Some Expert</a>
            <img height='1' width='3' border='0' alt='' src='/_layouts/images/blank.gif'><a class='ms-imnlink'
                onclick='IMNImageOnClick();return false;' href='javascript:'>
            <img height='12' width='12' border='0' id='3' ShowOfflinePawn='1' type='smtp' sip='[email protected]'
                src='/_layouts/images/blank.gif' valign='middle' name='imnmark' alt='No presence information' title=''>
        </a>
    </span>
</nobr>

After the HTML above is rendered on the page I call the following two lines of code:

//have to reset this value, otherwise ProcessImn() fails after next AJAX request
imnCount = 0;
ProcessImn();

Any ideas why it doesn't work in IE7/8?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX