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


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>
    function DisplayShare() {
        EnsureScriptFunc("sharing.js", "DisplaySharingDialog", function() {

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.