开发者

Dropdown is not generated for IE9

开发者 https://www.devze.com 2023-04-02 08:01 出处:网络
I had some issue with the dropdown not displaying the text but did contain the values in IE8. I followed john_doe\'s solution which worked.

I had some issue with the dropdown not displaying the text but did contain the values in IE8. I followed john_doe's solution which worked.

Now I have tried IE9 for the first time and the dropdowns are not generated at all. All other browsers work fine including IE8.

I can't see what might be the cause - can you explain the problem to me?

if(max_ch>0){
    var newDiv = $('<div>Room '+(i+1)+
        ' <select class="adu" name="data[Rate]['+r_id+']['+ro_id+
        '][adults][]"></select> adults. <select class="chi" name="data[Rate]['+r_id+
        ']['+ro_id+'][c开发者_StackOverflow中文版hildren][]"></select> children.</div>'
    );
    newDiv.attr("id","occupants"+i).appendTo(showdiv+' .rooms_adults');

    var roomPrice = $('<input type="hidden" name="data[Rate]['+r_id+']['+ro_id+'][prices][]" value="'+room_bo+'" />');
    roomPrice.attr("id","roomprice"+i).appendTo(showdiv+' .rooms_adults');

    var num_opts = Number(max_ad) + 1,
        slc_adu = $(showdiv+' #occupants'+i+' select.adu');
    for( ad=0; ad < num_opts; ad++){
        slc_adu.append("<option value=\"" + ad + "\">" + ad + "</option>");
    }

    var num_opts = Number(max_ch) + 1,
        slc_ch = $(showdiv+' #occupants'+i+' select.chi');
    for( ch=0; ch < num_opts; ch++){
        slc_ch.append("<option value=\"" + ch + "\">" + ch + "</option>");
    }

    $(showdiv+' #occupants'+i+' select.adu').val('1');                  
}


The issue was that I was using jquery 1.5 instead of 1.5.1

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号