IE下使用正常的控件,到了firefox3.5.5下面,报错:
String contains an invalid character
查了报错代码出现在这一段:
var chkBox=document.createElement('<input type="Checkbox" name="treeBox" value= '+key+'>');
firefox不支持这种createElement的定义方式,需要分步进行:
var chkBox = document.createElement('input');
chkBox.name = "treeBox";
chkBox.type = "checkbox";
chkBox.value = key;
问题解决。