Wednesday 15 April 2015

Javascript array mess -


As a result of coming from a request, I have the string filled with the following elements (javascript) in a string of three iterative PF properties The only sequence is.

  var str_before_split = "name1_address_telephone, name2_address_telephone, name3_address_telephone";   

By splitting different strings on a comma, I have an array that has 3 different strings, so I used to complete the partition: (Where boundary = 3, number May be different)

The problem occurred when I created three different arrays for three different categories Therefore, inside the initial loop, we :( I post a loop again)

  var les = limit * 3; // to see the maximum possible elements of the array (var i = 0; i   

Whenever the page runs, the script is stored. There is no mistake on my JS error search plugin. I tried to alert the arrays inside the small for the loops and even saw the correct result, the warning window will not be able to prevent it from appearing often. Any signals?

 for  (var j = 0; j & lt; les; i + 3) {Name [i] = every string [ja]; }   

say, "set j to 0 each time through the loop, j less than . Then evaluate i + 3 (a different variable), ignore the result and leave j alone. "You have an infinite loop, because there is nothing other than j 0 , and this will always be less than les .

You want something like this:

 for  (var j = 0; j & lt; les; j + = 3) {name [i] = every string [J]; }    

No comments:

Post a Comment