postJSON

jQuery.postJSON = function(data, url, success) {
    return jQuery.ajax({
        type: "POST",
        url: url,
        data: data,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: success
    });
};

使用

        $(function() {
            $.postJSON("{}", "Validate.asmx/GetPs", funOK);
        })

        function funOK(msg) {
            $.each(msg.d, function() {
                for (ee in this) {
                    if (ee != '__type') {
                        $('#inf').append(this[ee]);
                    }
                }
            })
        }

posted on 2009-03-08 17:56  啊啦星  阅读(1935)  评论(0)    收藏  举报