Skip to content

Instantly share code, notes, and snippets.

@wictorwilen
Created July 17, 2015 08:58
Show Gist options
  • Save wictorwilen/115eeab0925500f5a518 to your computer and use it in GitHub Desktop.
Save wictorwilen/115eeab0925500f5a518 to your computer and use it in GitHub Desktop.
Get Page Properties using JSOM
var context = SP.ClientContext.get_current();
var web = context.get_web();
var currentList = web.get_lists().getById(_spPageContextInfo.pageListId);
var currentListItem = currentList.getItemById(_spPageContextInfo.pageItemId);
context.load(currentListItem);
context.executeQueryAsync(
function(){
console.log('Success')
console.log(currentListItem)
console.log(currentListItem.get_item('PropertyName'))
},
function(){
console.log('Error')
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment