function createListFolder(siteUrl, listName, foldername) { var serverUrl = _spPageContextInfo.webAbsoluteUrl; $.ajax({ url: serverUrl + "/_api/Web/Folders/add('"+listName+"/"+ foldername+"')", type: "POST", headers: { "accept": "application/json; odata=verbose", "content-type": "application/json; odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val() }, error: function (data) { alert(data.responseText); //alert("fail"); } }); }