OCS 在基于 AJAX 的 SharePoint Web 部件中的存在
我目前正在实现基于 AJAX 的 Web 部件,用于显示搜索结果。此搜索结果包含用户名,并且与我正在呈现的 OCS 存在指示器的每个名称相反。该指示器在 IE6 中工作正常,但我无法让它在 IE7/8 中工作。
基本上,IE7/8 中的问题是 OCS 已渲染,但当您将鼠标悬停在其上时,没有显示任何内容。如果您尝试向下滚动页面,然后将鼠标悬停在 OCS 图标上,您将在页面底部看到 OCS 操作菜单,而不是在用户名的对面看到它。
我的基于 AJAX 的 Web 部件使用 jQuery post 方法向服务器发出请求并接收 json,然后将其渲染到 div。
我的用户名 HTML 如下所示:
<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>
在页面上呈现上面的 HTML 后,我调用以下两行代码:
//have to reset this value, otherwise ProcessImn() fails after next AJAX request
imnCount = 0;
ProcessImn();
有什么想法为什么它在 IE7/8 中不起作用?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确信错误放置的状态控件是由 SharePoint 2007 中的错误 init.js 引起的。init.js 不考虑滚动。由于您不应该接触开箱即用且破坏支持的文件,因此您可能需要破解自己的 JavaScript 来设置 ActiveX NameControl 的存在。我不能把修复归功于我。我通过谷歌搜索找到了它。不幸的是,我不记得在哪里读到过它。
如果您必须破解 SharePoint 2007 的 init.js,您可能想尝试以下操作:
在函数 IMNShowOOUI(inputType) 中,
我会将行从: 更改
为以下内容:
您可能想尝试破解 JavaScript,而不是 init.js附带 MS 示例 " Web 应用程序中的存在” 请注意,您必须对滚动问题应用相同的修复程序。
祝你好运:)
I'm sure that the misplaced presence controls are caused by the buggy init.js in SharePoint 2007. The init.js does not account for scrolling. Since you shouldn't touch files that are out-of-the-box and break support, you might want to hack your own JavaScript that sets up the ActiveX NameControl for presence. I can't take credit for the fix. I found it by Googling. Unfortunately, I cannot recall where I read about it.
If you must hack SharePoint 2007's init.js, you might want to try this:
In function IMNShowOOUI(inputType),
I would change the lines from:
to the following:
Rather than init.js, you might want to try hacking the JavaScript that comes with the MS example "Presence in Web Applications" Beware that you'll have to apply the same fix for the scrolling issue.
Good luck:)