admin管理员组文章数量:1296842
In Sharepoint, when we load the sp.js file after that when we use given code then it gives the current site context. But how can i get the site context using url.
var context = new SP.ClientContext.get_current();
In Sharepoint, when we load the sp.js file after that when we use given code then it gives the current site context. But how can i get the site context using url.
var context = new SP.ClientContext.get_current();
Share
asked Jan 29, 2014 at 13:37
Ravi VermaRavi Verma
1841 gold badge3 silver badges12 bronze badges
1
- Can you helo me with this abut. Ihave exact same line, but it just don´t work. dev tool in Chrome says Uncaught errortype: undefined is not a function. ANy hint about it? – Ricker Silva Commented May 9, 2014 at 22:24
2 Answers
Reset to default 5get_current()
would always return current context only. If you want to get context of particular site then you would need to pass url in ClientContext()
method.
var context = new SP.ClientContext(URL);
In case you want to get root site context then you can directly use get_root()
method.
Try this
var context = new SP.ClientContext(URL);
本文标签: javascriptGet ClientContext using URLStack Overflow
版权声明:本文标题:javascript - Get ClientContext using URL - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741645219a2390147.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论