0

I want to create a sharebutton within the O365 sharepoint online (classic envrionment). I have tried to duplicate the function from the top bar with no succuess

Within each page I would like the user to have a button to allow them to share with other team users

Please help

0

You can use JSOM and call DisplaySharingDialog function.

Demo: The following script is used to add a link to share the current site in SharePoint Online:

<a onclick='javascript:DisplayShare();'>share</a>
<script>
    function DisplayShare() {
        EnsureScriptFunc("sharing.js", "DisplaySharingDialog", function() {
            DisplaySharingDialog(_spPageContextInfo.webAbsoluteUrl);
        });
    }
</script>

Refer to:

SharePoint custom Sharing button

Assign "Share" functionality to a custom button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.