/carddav.js

carddav.js is a jQuery Plugin to access read-only CardDav Server (like DaviCal)

Primary LanguageJavaScriptMIT LicenseMIT

CardDav JS

Build Status

jQuery API to access read-only CardDav Server (like DaviCal)

logo!

Getting Started

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>

Reference

VCard Specification Format

Support

  • Chrome 16+
  • Firefox 10+
  • Safari 5.1+

Documentation

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 */
    }
} 

Release History

  • v0.2.1: bower published version
  • v0.2.0: initial revision, only support getting carddav values

License

Copyright (c) 2014 John Fischer
Licensed under the MIT license.