Forum Discussion
Clifford Adams
Dec 01, 2016Copper Contributor
PnP-JS-Core open web by url?
Every example I see of PnP-JS-Core uses the current web. How can I open a list from another web?
For anyone else searching for this. Here's how you do it:
var w = new $pnp.Web("/news"); w.lists.getByTitle("Alerts")....
- Deletedhave not seen the code but i guess you need to create your own clientcontext with site url and then go to the correct web.
- Clifford AdamsCopper Contributor
That's how you do it with CSOM, but PNP-Core is a wrapper for the REST services. Makes lots of things easier, but documentation is sketchy. Thanks for the response.
- Clifford AdamsCopper Contributor
For anyone else searching for this. Here's how you do it:
var w = new $pnp.Web("/news"); w.lists.getByTitle("Alerts")....