<script type="text/javascript">
var currentcontext = null;
var currentweb = null;
ExecuteOrDelayUntilScriptLoaded(RetriveSites, "sp.js");
function RetriveSites()
{
currentcontext = new SP.ClientContext.get_current();
currentweb = currentcontext.get_web();
this.subsites = currentweb.get_webs();
currentcontext.load(this.subsites);
currentcontext.executeQueryAsync(Function.createDelegate(this, this.ExecuteOnSuccess),
Function.createDelegate(this, this.ExecuteOnFailure));
}
function ExecuteOnSuccess(sender, args) {
var subsites = '';
var enum = this.subsites.getEnumerator();
while (enum.moveNext())
{
var Site = enum.get_current();
subsites += '\nID: ' + Site.get_id() + '\nTitle: ' + Site.get_title();
}
alert(subsites);
}
function ExecuteOnFailure(sender, args) {
alert("error");
}
</script>
Ads by Google
Hi!,
ReplyDeleteI tested and works, but only for people that have atleast permissions of Contribute…why?, the visitors have the follow message:
Access denied. You do not have permission to perform this action or access this resource.
Could you helpme?