Question

Alex Varghese on Mon, 01 Feb 2016 13:00:52


I have created a list in which there is a hyperlink column.

I need the URL to open in a new tab when clicked.

Please let me know if there is any setting in SharePoint 2013 to perform this action. Or is there any script that I can add to this page using content editor.

I found few scripts, but does not seem to work.

Please advice.


Sponsored



Replies

romeo donca on Mon, 01 Feb 2016 14:15:58


hi

you should edit the code for the hlink and add

target="blanck"inside it

Wendy DZ on Tue, 02 Feb 2016 03:03:50


Hi Alex,

From your description, you want to open a hyperlink in a new tab.

Assuming it is the AllItems.aspx page, you can add the following code into the page:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function () {
	$("table.ms-listviewtable>tbody tr td a").attr("target", "_blank");
});
</script>

A similar blog for your reference:

http://www.sharepointdotnet.com/2012/08/open-hyperlink-in-new-tab-using-jquery.html

Best Regards,

Wendy

Alex Varghese on Tue, 02 Feb 2016 08:36:13


Thank you. The solution Worked perfectly.