top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to Fill Drop Down list with JSON Array using Javascript

+2 votes

I am Getting may JSON array . But i can't know how to fill dropdown list with this array ...

  function Customer_Id()  
      var Cus_id = document.getElementById("customer").value;  
      var xhr;  
      if (window.XMLHttpRequest) // Mozilla, Safari, ... 
            xhr = new XMLHttpRequest();  
        else if (window.ActiveXObject) // IE 8 and older 
            xhr = new ActiveXObject("Microsoft.XMLHTTP");  
          var data = "Customer_ID=" + Cus_id;  

   "POST", "Volumne_WebUser.php", true);   
             xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");                    
              xhr.onreadystatechange = display_data;  
      function display_data() {  
     if (xhr.readyState == 4) {  
      if (xhr.status == 200) {  
      var response = xhr.responseText;
      var obj = JSON.parse(response);
      } else {  
        alert('There was a problem with the request.');          
posted May 6, 2014 by Abdul Moeed

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
@Abdul: I could not make out anything from this code, can you put more information and make sure your code is indented.

However I would encourage you to read the following links

Please comment or put more information so that someone can look into it...

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.