Sharepoint Links - How to Open in a New Tab / Window

I noticed that with Sharepoint 2010, many links do not support the new tab / window feature. For example, there is no quick menu in the menu. Can I turn it on?

+3
source share
6 answers

What is a quick menu? Is there a context menu for a list item or something else? Can you post a screenshot?

  • Two types of links are used.

  • Normal HTML bindings. You can hold the CTRL key while pressing.

JavaScript links (menus, etc.) CTRL key does not work. If you work with Edit / View forms, this may be of interest.

II, a > >

+1

JavaScript, SharePoint 2010.

, .

function load_url(externallink)
{
    window.open(externallink,target='_blank')
}

load_url JavaScript

, . , http://someserver/sites/Dev/Help/HelpLinks/AllItems.aspx

HelpLinks . Dev node (). , HelpLinks.

  • , , .

  • " ". URL javascript:load_url('http://www.google.co.in'); http:// www.google.co.in

, URL. URL: http:// someserver/sites/Dev/Help/HelpLinks/AllItems.aspx

  • http:// someserver/sites/Dev/Help/HelpLinks/AllItems.aspx

  • ( , URL, ..).

  • ,

  • URL javascript:load_url('http://www.google.co.in'); http:// www.google.co.in

+3

Internet Explorer. SharePoint 2010 , span. IE, , , , . ( "" ), , .

+1

, : http://sharepointsolutions.blogspot.com/2007/09/make-selected-links-in-links-list-open.html

1: #openinnewwindow , .

Step 2. Then you will need to add the following script pages to the SharePoint pages.

[script language = "JavaScript"]

//add an entry to the _spBodyOnLoadFunctionNames array
//so that our function will run on the pageLoad event
_spBodyOnLoadFunctionNames.push("rewriteLinks");

function rewriteLinks() {
  //create an array to store all the anchor elements in the page
  var anchors = document.getElementsByTagName("a");

  //loop through the array
  for (var x = 0; x < anchors.length; x++) {
    //does this anchor element contain #openinnewwindow?
    if (anchors[x].outerHTML.indexOf('#openinnewwindow') > 0) {
      //store the HTML for this anchor element
      oldText = anchors[x].outerHTML;
      //rewrite the URL to remove our test text and add a target instead
      newText = oldText.replace(/#openinnewwindow/, '" target="_blank');
      //write the HTML back to the browser
      anchors[x].outerHTML = newText;
    }
  }
}
[/script]
Run codeHide result
+1
source

In the Wiki editor for Windows, you can click the "From Address" link that you added, and the LINK menu appears in the ribbon bar. Inside this, you can click "Open in a new tab." This is not a completely new window, but it is close and easy.

0
source

Add this to the end of the link.

#openinnewwindow

example: http://www.bing.com**#openinnewwindow

-1
source

Source: https://habr.com/ru/post/1794764/


All Articles