Thursday 15 April 2010

javascript - sent parameter new Option(this.name, this.id) to function error -


समस्या मैं

  function set_select_option (select_name, start_value, डेटा, new_option) को फ़ंक्शन बनाना चाहता हूं ) {Select_name.empty (); Select_name.append (नया विकल्प (start_value.toString (), 0)); $ .each (डेटा, फ़ंक्शन () {select_name.append (new_option);}); };   

मैं इसका उपयोग करना चाहता हूं

  set_select_option ('# select1', 'name0', डेटा 1, नया विकल्प (this.name, this.id)) ;   

लेकिन यह त्रुटि

  विकल्प (this.name, this.id)   

कैसे तय करने के लिए? क्या हो सकता है?

क्या आप यह कोशिश कर सकते हैं?

  function set_select_option (Select_name, start_value, डेटा) {select_name.empty (); Select_name.append (नया विकल्प (start_value.toString (), 0)); $ .each (डेटा, फ़ंक्शन () {select_name.append (नया विकल्प (this.name, this.id));}); };    

No comments:

Post a Comment