SoFunction
Updated on 2025-02-28

js solves "options are empty or not object"

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.
  • options
  • Empty
  • Not an object

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 effect
    2008-11-11
  • A way to judge Checkbox and Radio

    A way to judge Checkbox and Radio...
    2006-08-08
  • Method to quickly determine whether a value is in select

    A method to quickly determine whether a value is in select...
    2006-09-09
  • javascript clear data in the input box

    Clear the data implementation code in the input box.
    2009-04-04
  • A 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 form
    2009-10-10
  • JS 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-04
  • Another good way to implement secondary connection

    Another good way to implement secondary connection...
    2007-01-01
  • Collection of options operation methods in javascript Select tag

    A comprehensive collection of options methods in select using js
    2008-10-10
  • A very simple way to achieve the highlighting effect of TD.

    A very simple way to achieve the highlighting effect of TD...
    2006-09-09
  • javascript checkbox selection/select all effects

    JavaScript check box selection/select all effects...
    2007-07-07

Latest Comments