Javascript: function and its argument -


I have a problem with my function and its arguments ... this code is: < / P>

  function alab () {var up = arguments [0]; Var id = logic [1]; Lane = arguments Long-3; For (var an = 1; a & lt; = 10; a ++) {arg = (logic [2] + a); // id tag html: [nome] [num] document.getElementById (arg) .style.display = "block"; } (Var i = 3; i & lt; len; i ++) {warning ('test1'); Document.getElementById (argument [i]). Style.display = "none"; Warning ('test2'); } Change_price (above, id); }   

The script is hanging in another cycle: It prints 'test1' , but does not print 'test2' . Where's the error? Thx all;)

Note that this advice should be used for all things: (var i = 3; i & lt; len; i ++) {var node = document.getElementById (argument [i]); If (node) {node.style.display = "none"; In other words, if any element can be found if you are not 100% sure to be even more pedantic: i



  • Comments

    Popular posts from this blog

    c - Mpirun hangs when mpi send and recieve is put in a loop -

    python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

    java - Unable to get JDBC connection in Spring application to MySQL -