﻿(function($) {
    jQuery.ws = function(o) {
        $.ajax({
            type: "POST",
            dataType: "json",
            contentType: "application/json; charset=utf-8",
            url: o.url,
            data: $.toJSON(o.data) || "{}",
            success: function(data) {
                if (typeof(data.d)!='undefined')
                    o.success(data.d);
                else
                    o.success(data);
            },
            error: o.error
        });
    }
})(jQuery);
