Wednesday, July 23, 2014

Get all Site and Subsites collection from other Web Application within the server

<div id="divContainer"></div>
<script src="/jquery.js/" type="text/javascript"></script><script src="//SPAPI_Core.js" type="text/javascript"></script><script src="/SPAPI_Webs.js" type="text/javascript"></script>

<script type="text/javascript">
s = new SPAPI_Webs(siteURL);
var xmlhttp= webs.getAllSubWebCollection();
if(xmlhttp.status == 200){
var xmlDoc = xmlhttp.responseXML;
var Webid= xmlDoc.getElementsByTagName("Web");
var html= '<table>';
for (i=0;i<Webid.length;i++) {
   var linkTitle = Webid[i].attributes.getNamedItem("Title").nodeValue;
   var linkURL = Webid[i].attributes.getNamedItem("Url").nodeValue;
   html = html + '<tr><td>';
   html = html + '<p style="border-radius:10px;background-color:Silver;border:2px solid black"><a href="' + linkURL + '">' + linkTitle + ' <img src="PlayButton.jpg" style="height:15px;width:15px;float:right" alt="linkButton"/></a></p>';
   html = html + '</td></tr>';
   }
}
html=html + "</table>";
document.getElementById("divContainer").innerHTML=html;

</script>

No comments:

Post a Comment

Building Secure Azure AI Foundry Agents with Managed Identity

  The credential problem nobody wants to own Every team that connects an Azure AI Foundry agent to Microsoft Graph, SharePoint, Outlook, or...