Created
April 12, 2012 02:50
-
-
Save bradmac/2364354 to your computer and use it in GitHub Desktop.
Create a folder from jquery using ajax and the milton DAV gateway
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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