javascript - Jquery with Json response is showing extra values -


i have jquery question.

$.ajax({          type: 'get',  	    datatype: 'json',          url:'/bin/getpath',          success: function(jsonarray){              for(var in jsonarray) {                  $("#myselect").append("<input type='radio' name='path'   value='"+jsonarray[i]+"'> "+jsonarray[i]+"</input><br/>");              }          }      });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">  </script>  <div id ="myselect"></div>

and json response url :

enter image description here

when running code, working fine in firefox although same code showing 1 more radio button below. please :

enter image description here

regards, td

below working code :

$.ajax({     type: 'get',     datatype: 'json',     url:'/bin/getpath',     success: function(jsonarray){         $.each(jsonarray,function(index,value){             $("#myselect").append("<input type='radio' name='path' value='"+value+"'> "+value+"<br/>");         });     } }); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -