我正在使用SharePoint 2010,其中一个aspx页面包含Note Board Web部件,它提供了简单的功能,可以在给定页面上留言。使用JQuery在任何AJAX调用之后修改DOM我无法控制
当页面加载时,评论由该Web部件使用AJAX检索,我无法控制AJAX调用何时完成。
我试图插入在每个表中的数据标签的链接或一些文字,Web部件使用的意见,即
<td class="socialcomment">Comment 1</td>
<td class="socialcomment">Comment 2</td>
<td class="socialcomment">Comment 3</td>
到使用JQuery这样
<td class="socialcomment">Comment 1 <a href="#">Report inappropiate</a></td>
<td class="socialcomment">Comment 2 <a href="#">Report inappropiate</a></td>
<td class="socialcomment">Comment 3 <a href="#">Report inappropiate</a></td>
$('td.socialcomment').append(' <a href="#">Report inappropiate</a>');
我还没有能够在上面的场景中使用jQuery的live()函数(wo为了其他场景我有),但我认为这是因为它是为事件设计的。 我也尝试过.ajaxComplete(),但它并没有完全实现,因为我没有控制Ajax调用或SharePoint执行的Ajax调用未使用JQuery注册。
任何帮助或洞察力非常感谢。 在此先感谢!