简体   繁体   中英

How to Add a ScriptLink on the Host Web from a SharePoint Hosted App with JSOM

I'm trying to add a scriptLink on the Host web from a SharePoint hosted app using JSOM.

I found some articles that give the samples to do this (eg http://booden.net/JsomAddScriptLinkOnHostWeb.aspx ), but it doesn't work anymore.
Even though I've given the full permission to the app, I still got this error message:

Request failed: Access denied. You do not have permission to perform this action or access this resource.

Is it still possible to do this?

Apparently, the error occurs when I run the solution from visual studio. Once I publish the app then upload and install the app, it works as expected.

As a conclusion, it is possible to add a ScriptLink on the Host Web from a SharePoint Hosted App using JSOM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM