Skip to content

Instantly share code, notes, and snippets.

@bradmac
Created April 12, 2012 02:50
Show Gist options
  • Save bradmac/2364354 to your computer and use it in GitHub Desktop.
Save bradmac/2364354 to your computer and use it in GitHub Desktop.
Create a folder from jquery using ajax and the milton DAV gateway
function createFolder(name) {
var encodedName = name; //$.URLEncode(name);
ajaxLoadingOn();
$.ajax({
type: 'POST',
url: "_DAV/MKCOL",
data: {
name: encodedName
},
dataType: "json",
success: function() {
ajaxLoadingOff();
window.location = encodedName + "/index.html";
},
error: function() {
ajaxLoadingOff();
alert('There was a problem creating the folder');
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment