亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery選中select控件 無法設(shè)置selected的解決方法

 更新時(shí)間:2010年09月01日 00:07:34   作者:  
select 控件的 option用jQuery動(dòng)態(tài)添加,然后選中某項(xiàng)時(shí),IE6不能執(zhí)行(火狐沒問題),用try{}catch(err){alert(err.description);}提示為“無法設(shè)置selected屬性 未指明的錯(cuò)誤”
解決辦法:把選中option的語句放到setTimeout中,例:
復(fù)制代碼 代碼如下:

setTimeout(function() {
var selSorts = $("select[id^='" + controls.selsort + "']");
$.each(selSorts, function(index, sort) {
var ope = $(sort).find("option[value='" + arrSort[index] + "']");
if (ope.length > 0)
ope[0].selected = true;
});
}, 1);

相關(guān)文章

最新評論