Exception... "Not enough arguments [nsIDOMHTMLSelectElement.add]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" lo+
关于select添加<option>元素时,出现[Exception... "Not enough arguments [nsIDOMHTMLSelectElement.add]" 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代替。