此代码在FF中正常工作,而不是在IE中。jquery append不工作在IE工作正常在FF
var target = $("#targetSelectBox")
var vals = values.split(";");
for (var i = 0; i < vals.length; i++) {
var parts = vals[i].split(":");
target.append($('<option />').val(parts[0].trim()).text(parts[1].trim()));
}
你为什么要接受一个答案这里(http://stackoverflow.com/questions/2111859/jquery-populate-select-box-with-keyvalue-pair)如果解决方案没有工作? – Sampson 2010-01-21 19:49:58
与Firefox正常工作,当我在IE浏览器尝试它没有工作:) – Shah 2010-01-22 14:55:08