Run script in Sharepoint

Marenka Vooijs (Qompas) 0 Reputation points
2024-03-26T09:27:33.5933333+00:00

In Sharepoint we want to place an encrypted link, which opens an external url. The encryption is created by a small script.

It looks like this:

<script src='//www.myownwebsite.com/script.php'></script>

<a rel='nofollow' href='https://myownwebsite.com' target="_blank">Click me</a>

The script alters the url, so that the link is valid for an hour only (for example).

Nowadays scripts are blocked in Sharepoint. Is there another way to achieve this?

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2024-03-27T02:17:09.33+00:00

    Hi @Marenka Vooijs (Qompas),

    Since script editor is not available in SharePoint for Microsoft 365 modern pages. You will need to use SharePoint Framework to custom your web part. Please refer to following document

    Where are the Content editor and Script editor web parts in SharePoint?

    You can build the SPFx solution package from https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-script-editor.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.