首页 > 代码库 > ajax常用

ajax常用

function suggesn() {    var suggesn_c = $("#suggesn_c").val();    if (suggesn_c.length < 10 || suggesn_c.length > 250) {        alert("请输入10-250位字符");        $(#suggesn_c).focus();        return false;    }    $.ajax({        type: "post",        //async:false,        url: "index.php?m=content&c=index&a=suggestion",        data: "type=yijian&suggesn_c=" + suggesn_c,        dataType: "json",        success: function (savedata) {            if (savedata[result] == 1) {                alert(感谢您的反馈!);                $("#suggesn_c").val(‘‘);                $(".fudong_app_pl_content").hide();            }        }    });}
function drop_audio_list(){            $.ajax({        type: "get",        async:false,        url: index.php?m=content&c=media&a=drop_audio_list&delete_id=&num=+Math.random(),        dataType: "json",        success: function(savedata){                if(savedata[status]==1){                                    for(var i=0;i<$(#playlist-demo li).length;i++){                                                //alert($(‘#playlist-demo li‘).eq(i).data(‘link‘));                            player.remove($(#playlist-demo li).eq(i).data(link));    //播放列表中移除                        }                    $("#playlist-demo").html(‘‘);                     player.reset();                }            }    });}

 

ajax常用