jQuery API to access read-only CardDav Server (like DaviCal)
Download the production version or the development version.
In your web page:
<script src="jquery.js"></script>
<script src="cardav.js.min.js"></script>
<script>
jQuery(function($) {
$.carddav.get({
url: '<DaviCal-Server>/caldav.php/user/addressbook/',
user: 'user',
passwd: 'secret',
error: function(jqXHR, textStatus, errorThrown) {
/* here handle error exception */
},
success: function(vcardArray) {
/* here your code */
}
});
});
</script>
- Chrome 16+
- Firefox 10+
- Safari 5.1+
vcardArray is an array of vcard Object.
vcard = {
url: '/caldav.php/user/addressbook/UUID.vcf',
vcard: {
bday: Object,
categories: Array[1],
email: Object,
fn: String,
n: String,
note: String,
rev: String,
tel: Object,
uid: String,
version: String,
/* some other properties */
}
}
- v0.2.1: bower published version
- v0.2.0: initial revision, only support getting carddav values
Copyright (c) 2014 John Fischer
Licensed under the MIT license.