jake0719 发表于 2013-1-29 12:42:33

[Exception... "Not enough arguments [nsIDOMHTMLSel

Exception... "Not enough arguments " nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" lo+
关于select添加<option>元素时,出现" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" lo错误
一般是select对象加option的时候抛出的错误。
这是由于写法document.getElementById(**).add(new Option(**,**));导致的。它不符合W3C dom标准写法。
解决办法:
1. document.getElementById(**).options.add(new Option(**,**));
2. document.getElementById(**).appendChild(new Option(**,**));
 
另, 用xmlHttprequest会有浏览器不兼容的问题, 建议用ajax代替。
页: [1]
查看完整版本: [Exception... "Not enough arguments [nsIDOMHTMLSel