SharePoint 2019 on premise REST API

SHUO .H 706 Reputation points
2021-02-23T05:54:31.237+00:00

Hi there,

I have two site collection: one is Personal Site Host another is Team Site. I customize a OneDrive for every personal site for control each site status. there are some code I added in OneDrive.aspx. you could refer to the attachment. If we access the personal site, everything works nicely. On the contrary, If we access the Team Site, the OneDrive.aspx also will be involved and the custom JS will be performed, then I got the following error:

70899-untitled.png

Here is the OneDrive.aspx I amended.

70959-onedrive.txt

The error code is (Red line):

70880-2021-02-23-13-46-37.png

Does anyone have any idea on it? thanks

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint Server | Development
{count} votes

2 answers

Sort by: Most helpful
  1. trevorseward 11,711 Reputation points
    2021-02-23T18:19:02.397+00:00

    Customizing OneDrive sites is not supported.

    0 comments No comments

  2. sadomovalex 3,636 Reputation points
    2021-03-01T15:43:11.867+00:00

    looks like at least ports of your Teams site and My Site host are different. In order to avoid CORS problem protocol, host and port should be the same: CORS error on same domain.

    0 comments No comments

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.