in reply to Re^2: copying perl array to javascript array
in thread copying perl array to javascript array
Did you forget to close your SELECT tag?
How about you show us runnable code that exhibits the problem.
By the way. I can't find any documentation for Option's contructor. In fact, according to the documentation, nodes should be created using createElement and createTextNode methods. What follows uses the correct methods.
function do_populate_cb(s) { var arr = deserialize_string_list(s); var options = document.doc1.selCourseNm.options; var i; // Remove any options it currently has. options.length = 0; // Add new options. for (i=0; i<arr.length; i++) { var option = document.createElement('OPTION'); option.value = arr[i]; option.innerText = arr[i]; options.add(option); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: copying perl array to javascript array
by Rainmaker (Acolyte) on Aug 05, 2005 at 21:07 UTC | |
by Joost (Canon) on Aug 09, 2005 at 22:23 UTC |