PHP批量审核ajax jquery

var jQuery = $.noConflict();
// alert(jQuery);
jQuery(document).ready(function()
{
    /*批量审核*/
    jQuery('input[name=tj]').click(function()
    {
        var i=0;
        var data={};
        jQuery('input[name=key]').each(function(i)  /*遍历数组取dom值*/
        {
            //this.checked=!this.checked;
            if(jQuery(this).val()!=0)
            {
                if(this.checked==true)
                {
                    data[i]=jQuery(this).val()
                    // alert(data[i]);
                }
            }
        })

        jQuery.post('{:U(\'News/setOn_all\')}',data,function(res)   /*ajax发送数组*/
        {
            if(res)
            {
                alert('审核成功');
                window.location.reload(true);
            }else
            {
                alert('审核失败~或该项目已经审核!');
            }
        })
        return false;
        
    });


});

 

posted @ 2015-05-20 15:10  天涯alone  阅读(273)  评论(0编辑  收藏  举报