js solves "options are empty or not object"
Updated: December 22, 2008 15:43:12 Author:
The old prompts the script error: "options are empty or not an object", but use document. or the object can be retrieved.
Yesterday, I encountered a strange problem when I was doing ip/pv statistics page. I put a select control on the page. The id of the control is selectMonth, but when using js to dynamically increase its option, the script error was always prompted: "options are empty or not an object", but using document. or the object can be retrieved.
I searched for a long time but couldn't find the reason. There was no way, so I could only go around a long way, put a div in the original select control, and then dynamically create a select using js, and then put the select into the div.
I've forgotten that, but today I'm going to add a select control to this page. I'm sorry to me if I continue to live like this. I've searched for a long time and checked almost all the related files. Finally, I finally found a control dynamically created in this js calendar control. The id of this control is also named selectMonth, which is really dizzy.
The problem is solved, and learn from this.
I searched for a long time but couldn't find the reason. There was no way, so I could only go around a long way, put a div in the original select control, and then dynamically create a select using js, and then put the select into the div.
I've forgotten that, but today I'm going to add a select control to this page. I'm sorry to me if I continue to live like this. I've searched for a long time and checked almost all the related files. Finally, I finally found a control dynamically created in this js calendar control. The id of this control is also named selectMonth, which is really dizzy.
The problem is solved, and learn from this.
Related Articles
Regional selection effect of imitating 51JOB (multiple regions can be selected)
The following is the HTML web page special effect code. Click the Run button to view the effect2008-11-11A way to judge Checkbox and Radio
A way to judge Checkbox and Radio...2006-08-08Method to quickly determine whether a value is in select
A method to quickly determine whether a value is in select...2006-09-09javascript clear data in the input box
Clear the data implementation code in the input box.2009-04-04A solution to get focus on the first non-hidden element in a form
A solution to get focus on the first non-hidden element in a form2009-10-10JS code that captures input text box content change event
input The content of the text box changes. We can use onchange or onblur to make judgments. However, onchange occurs when the text content changes and then loses focus. Onblur occurs when the focus is lost and will not judge by yourself.2010-04-04Another good way to implement secondary connection
Another good way to implement secondary connection...2007-01-01Collection of options operation methods in javascript Select tag
A comprehensive collection of options methods in select using js2008-10-10A very simple way to achieve the highlighting effect of TD.
A very simple way to achieve the highlighting effect of TD...2006-09-09javascript checkbox selection/select all effects
JavaScript check box selection/select all effects...2007-07-07