0

I have to run code for creation of lists in SharePoint site (Host-web) when my SharePoint Hosted app is installing. I have 3 to 4 App-parts in my App.

Where should I write JavaScript code which will run when my app is installing.

4
  • You want to add list to Host-web or App-web?
    – AmitWiki
    Commented Mar 30, 2016 at 12:38
  • I want to add a list in App-web Commented Mar 30, 2016 at 12:42
  • Is it SP Hosted app or Provider hosted app?
    – AmitWiki
    Commented Mar 30, 2016 at 12:48
  • It is SP Hosted app Commented Mar 30, 2016 at 12:49

1 Answer 1

-1

Create your script file and give reference of the file on first page which will load while installing your app. The reference should be like this

 <script src="../Scripts/yourScript.js" type="text/javascript"></script>
1
  • This is, in the most basic sense, correct - but not very helpful... you should explain why you need to do it this way and how "setup" of SP hosted apps is different than for provider hosted apps because of things like app permissions and server events.
    – John-M
    Commented Mar 30, 2016 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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