java - After passing javascript array to servlet, how do I edit? -


i have javascript array i've passed java. array of user input data. want list of user input data editable, first javascript array editable code array?

form.addeventlistener('submit', collectdata, false);  function collectdata(e) {     var usersites = [];     var cache = document.getelementbyid('cache');     var z = 0;     while (z < max_fields) {         z++;         var data = inputs[z].val();         usersites.push(data);     }      e.stoppropagation();     cache.value = usersites; } 

i want user able go , edit list later if choose , array update when happens. don't know javascript, know lot java. in java know array list better this, works in javascript?

arrays in javascript modifiable, unlike java. javascript arrays not fixed length, , items can added , removed without issues.

slightly unrelated, noticed in example; javascript arrays 0-indexed, java, in while loop, incrementing z before ever gets chance parse 0-th element. did mean that?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -