문제

I have a forms library with a few Infopath forms in them. I want to make it so that clicking on the form will open it in a new window/tab. I have added a CEWP with Javascript to give the hyperlinks the target blank attribute, but they still continue to open in the same window.

<script type="text/javascript">
$(document).ready(function(){
    $('#onetidDoclibViewTbl0 a').attr('target', '_blank');}
);
</script>
도움이 되었습니까?

해결책

Never mind I figured it out. There was an onclick function for the hyperlinks that was causing it to open in the same window. I followed the instructions from this post and fixed it.

Opening a document in a SharePoint 2013 document library in a new tab (using code)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top