// コンテキスト取得
var custCtx = SP.ClientContext.get_current();
// サイトオブジェクト取得指示
var custWeb = custCtx.get_web();
// サイトオブジェクト取得予約
custCtx.load(custWeb);
// サーバーへのクエリー実行(ここまでのコンテキストに含まれる指示予約を送信)
custCtx.executeQueryAsync(
function(sender, args) { // クエリー実行時コールバック処理
console.log(custWeb);
// ここで各種処理
},
function(sender, args) { // クエリー失敗時コールバック処理
console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
);
More than 5 years have passed since last update.
SharePoint Client Object Model でサイト オブジェクトを取得するコード
Posted at
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme