Created
July 17, 2015 08:58
-
-
Save wictorwilen/115eeab0925500f5a518 to your computer and use it in GitHub Desktop.
Get Page Properties using JSOM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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