Tuesday, January 3, 2012

Creating a SubFolder Using JavaScript Querying SharePoint

<script language="javascript" type="text/javascript" src="http://agmsm:9999/sites/Venkat/Sample/My%20Documents/SPAPI_Core.js"></script>
    <script language="javascript" type="text/javascript" src="http://agmsm:9999/sites/Venkat/Sample/My%20Documents/SPAPI_Lists.js"></script>
    <script language="javascript">
function CreateSubFolder()
{
var lists = new SPAPI_Lists('http://agmsm:9999/sites/Venkat/Sample/');
    
var res = lists.createFolder('MyList', document.getElementById("txtCreateSubFolder").value, 'http://agmsm:9999/sites/Venkat/Sample/Lists/MyList/Testfolder2');
if (res.status == 200)
{
  alert('The folder was created.');
}
else
{
 alert('Folder Already Existing');
}
}

    </script>

No comments:

Post a Comment