Skip to content

Instantly share code, notes, and snippets.

@wictorwilen
Created March 12, 2015 09:53
Show Gist options
  • Save wictorwilen/7e89d3e55f705c8eb85d to your computer and use it in GitHub Desktop.
Save wictorwilen/7e89d3e55f705c8eb85d to your computer and use it in GitHub Desktop.
Enumerate SPWeb properties in JSOM
var context = SP.ClientContext.get_current()
var web = context.get_web()
var props = web.get_allProperties()
context.load(web)
context.load(props)
context.executeQueryAsync(
function () {
var t = "Properties\n"
for (var z in props.get_fieldValues()) {
t += z + ": " + props.get_item(z) + "\n"
}
alert(t)
},
function () {
alert('Error')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment