在Sharepoint左侧导航中将文本设置为超链接

时间:2018-11-22 11:49:09

标签: jquery sharepoint sharepoint-2013 sharepoint-online

我在Sharepoint 2016中使用日历。我如下图所示创建了团队日历。但是,它不是超链接。我需要它作为超链接。我有可在控制台中使用的代码,但在脚本编辑器中添加后无法使用

 $('.ms-acal-apanel > ul >li > ul > li > span').each(function(){
    $(this).wrapInner('<a href="https://surendramouryacg.sharepoint.com/sites/testlearn/Lists/Team%20Calendar/calendar.aspxx" />');
});

left navifation

任何帮助将不胜感激。预先感谢。

1 个答案:

答案 0 :(得分:1)

添加脚本编辑器内容,如下所示:

<script type="text/javascript">
function initMyLinks(){
$('.ms-acal-apanel > ul >li > ul > li > span').each(function(){
    $(this).wrapInner('<a href="https://surendramouryacg.sharepoint.com/sites/testlearn/Lists/Team%20Calendar/calendar.aspxx" />');
});
}
_spBodyOnLoadFunctionNames.push("initMyLinks");
</script>

<script type="text/javascript">
            function initMyLinks(){
            $('.ms-acal-apanel > ul >li > ul > li > span').each(function(){
                $(this).wrapInner('<a href="https://surendramouryacg.sharepoint.com/sites/testlearn/Lists/Team%20Calendar/calendar.aspxx" />');
            });
            }
            ExecuteOrDelayUntilBodyLoaded(initMyLinks);
</script>
相关问题