sharepoint 2013 自己定义列表查看页面附件打开新页面方法 dispform attachments open new page

我们在sharepoint的列表中,打开某一条数据,假设那条数据有附件。打开附件的时候。总是会把当前的页面给替换掉。怎样在点击附件的时候,打开新页面。能够用一下一段脚本来处理。

<script>

$(document).ready(function () {

    if ($("#idAttachmentsTable") != null) {

        $('#idAttachmentsTabletbody tr td').each(function () {

            if(window.location.href.indexOf('DispForm.aspx') > -1) {

                var href = $(this).find('a');

               href.removeAttr("onclick");

               href.attr("target", "_blank");

            }

        });

    }

});

</script>

原文地址:https://www.cnblogs.com/wgwyanfs/p/6776896.html