首页 > 代码库 > jquery pass parameter to ajax callback

jquery pass parameter to ajax callback

 

 

 

            $(‘.del‘).on(‘click‘, function () {                var id = $(this).attr(‘id‘);                var url = ‘/m/g2_content_del/‘ + id;                var that = this;                $.post(url, function (a, b, c, d) {                    var getItem = function () {                        return function () {                            return that;                        };                    }                    var current = getItem()();                    var data =http://www.mamicode.com/ a;                    if (data.status == 200) {                        $(current).parent().parent().remove();                    }                });            });