限时免费试用:欢迎注册 api.bigmodel.org ,快速体验大模型 API 接入服务。
当前位置:首页 >前端技术 >JQuery/js

select 改变时,执行ajax操作

分类:JQuery/js时间:2018-08-02浏览:3410


$(".ss1").on('change',function(){
    // var pid = $(".select01 option[selected='selected']").val();
    var pid = $(".select01 option:selected").val();
    // var pay_num = $("#pay_num li[class='on']").attr("rel");
    // console.log(pid);
    $.ajax({
        type:'get',
        url:'__URL__/ajax_fan2.html',
        data:{id:pid},
        dataType:'json',
        success:function(res){
            if(res.result==1){
               // alert(res.msg);
                // alert(res.msg.length);
                var html='';

                $(".ss2").html('');
                html+='';
                for(var i=0;i'+res.msg[i].name+'';

                }
                $(".ss2").append(html);

               // location.href="__APP__/member/index.html"
            }else{
                // alert(res.msg);
            }

        }
    })
     
  })
本站文章如未注明出处均为原创,转载请注明出处,如有侵权请邮件联系站长。
0/500
Share your thoughts respectfully.