简体   繁体   中英

Jquery Ajax success function not working

Ajax success function not working. my php page return the value but not coming into success function. I am using the following code

$(document).ready(function(){
    $('#yealysearch').click(function(){
        var year=$('#sel_year').val();
        $('#yearlydata').val('');
        $.ajax({
            type:"POST",
            url:"get_yearlyreport.php",
            data:{year},
            cache: false,
            success:function(data)
            {
                alert('sdfsdfsdf');
            },
            error: function(ts) { alert(1) }
        }); 
    });     
})

Thanks

data:{year},

改成 :

data:{year : year},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM