如何将jQuery应用于SharePoint分组列表视图
我正在尝试将SharePoint列表项“编辑”图标更改为SharePoint 2007网站上的新图像。通过对母版页应用一些jQuery,我已经使它运行良好。我遇到的问题是,任何配置为“分组”的列表视图都不会获得新图标,因为HTML没有在document.ready上呈现。加载页面后,一旦展开分组,就会添加HTML 我的问题是,如何将jQuery/Javascript应用于页面加载后呈现的html 下面是我正在使用的简单代码如何将jQuery应用于SharePoint分组列表视图,jquery,sharepoint,Jquery,Sharepoint,我正在尝试将SharePoint列表项“编辑”图标更改为SharePoint 2007网站上的新图像。通过对母版页应用一些jQuery,我已经使它运行良好。我遇到的问题是,任何配置为“分组”的列表视图都不会获得新图标,因为HTML没有在document.ready上呈现。加载页面后,一旦展开分组,就会添加HTML 我的问题是,如何将jQuery/Javascript应用于页面加载后呈现的html 下面是我正在使用的简单代码 <script language="javascript">
<script language="javascript">
$(document).ready(function() {
$("img[src*='edititem.gif']").attr("src","<URL to New Img>").attr("title","Comment");
});
</script>
$(文档).ready(函数(){
$(“img[src*='edititem.gif'])attr(“src”,“Comment”).attr(“title”,“Comment”);
});
您可以使用来执行此操作
它看起来像这样
$(document).ready(function() {
$("img[src*='edititem.gif']").livequery(function(){
$(this).attr("src","").attr("title","Comment");
});
});
尝试:
_spBodyOnLoadFunctionNames.push(“FunctionName”);
函数FunctionName()
{
$(“img[src*='edititem.gif'])attr(“src”,“Comment”).attr(“title”,“Comment”);
}
我使用的是jQuery 1.6.2,无法实现此功能。我不知道这是否与母版页中的代码或SharePoint中阻止liveQuery(and.live)工作的其他内容有关。我很感激你的建议
<script language="javascript">
_spBodyOnLoadFunctionNames.push("FunctionName");
function FunctionName()
{
$("img[src*='edititem.gif']").attr("src","<URL to New Img>").attr("title","Comment");
}
</script>