Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

JavaScript to open links in new tab - not working for all sites

$
0
0

In SharePoint Online, I created a few Pages within a site where I put Content Query Search Web Parts. On Other Pages, I have placed Content Query Tool Web Part. These web parts are retrieving documents from a Document Library.

I placed the following code in a Scripts Editor Web Part below the Content Query Search or Content Query Tool Web Part,

<script>
    $(document).ready(function(){
        $('ul > li > div.ja-doc-list > a').attr('target','_blank')   
});
</script>

For Content Query Search Web Part, I can see the displayed documents opening in a new tab when I click on a document. But for Content Query Tool Web Part, this logic does not work.

Not sure what is going on. Do I need to change anything in Web Part Properties?

Thanks a bunch!

Mayank


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>