title: Split items separated by commas (,) in Javascript
body: <p>My Javascript var contains a 2D array.
  If I pop an alert on the the var i get the JSON serialized result, something like:</p>
  
  <pre><code>ID0, DESCRIPTION
  </code></pre>
  
  <p>I'd like to get each items separated by the , in the value option of the dropdownlist and the other item in the description.</p>
  
  <p>Here's my Javascript code, it would work if split was working correctly but this pops an error because the var doesn't contain a pure string type.</p>
  
  <pre><code>$.ajax(
          {
              type: "POST",
              url: "Projet.aspx/GetDir",
              data: "{VP:'" + dd_effort_vp + "',DP:'" + dd_effort_dp + "',Direction:'" + dd_effort_d + "'}",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(response) {
                     var cars = response.d;
                      $.each(cars, function(index, value) {
                      $('#&lt;%= dd_effort_directionp.clientid()%&gt;').append(
                   $('&lt;option&lt;/option&gt;').val(value[value.split(",",0)]).html(value.split(",",1))
  
  
  
  
  
                  }
              }
          });
  </code></pre>
  
  <p>I know split doesn't work that way here because of the return value is not a string but you get the result i'd like to achieve, get the first value before the comma has the VALUE of the Dropdownlist and the item after the comma as the HTML text.</p>
  
  <p>Thanks ALOT!</p>