<script type="text/ecmascript">
function getWebProperties() { var ctx = new SP.ClientContext.get_current();
if (ctx != undefined && ctx != null) {
this.web = ctx.get_web();
ctx.load(this.web); ctx.executeQueryAsync(Function.createDelegate(this, this.onSuccess), Function.createDelegate(this, this.onFail)); } } function onSuccess(sender, args) { var cTypeColl = this.web.get_contentTypes();
if (cTypeColl != undefined && cTypeColl != null) { alert('Get Content Types!'); }
var cFields = SP.ContentType.get_fields();
if (cFields != undefined && cFields != null) { alert('Get Fields!'); }
alert('web title:' + this.web.get_title() + '\n ID:' + this.web.get_id() + '\n Created Date:' + this.web.get_created()); } function onFail(sender, args) { alert('failed to get list. Error:'+args.get_message()); }
</script>
Like this:
Like Loading...
Related
Leave a Reply