如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
<select class="select01 ss1" name="pp"> <option class="pid" value ="0">ALL</option> <?php foreach($pp as $k=>$vo): ?> <option value ="{$vo['cid']}">{$vo['name']}</option> <?php endforeach; ?> </select> $(".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+='<option value ="0">size</option>'; for(var i=0;i<res.msg.length;i++){ html+='<option value ="'+res.msg[i].cid+'">'+res.msg[i].name+'</option>'; } $(".ss2").append(html); // location.href="__APP__/member/index.html" }else{ // alert(res.msg); } } }) })