accedere a Json Array multidimensionale

  • Creatore Discussione Creatore Discussione ans66
  • Data di inizio Data di inizio

ans66

Utente Attivo
27 Ago 2011
158
0
16
Ciao a tutti,

Ricevo un array multidimensionale come segue:

Codice:
function GetDataArray(form_tag, xURL)
	{
		
			var xmlhttp=false;

			
			if (!xmlhttp && typeof XMLHttpRequest!='undefined')
			{
				try { xmlhttp = new XMLHttpRequest(); }
				catch (e) { xmlhttp = false; }
			}
			if (!xmlhttp && window.createRequest)
			{
				try { xmlhttp = window.createRequest(); }
				catch (e) { xmlhttp = false; }
			}

			xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState===4 && xmlhttp.status===200)
				{
          
					data = JSON.parse(xmlhttp.responseText);
          
          SetValuesTesti(data);
				}
			}
			xmlhttp.open("GET", xURL, true);
			xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
			xmlhttp.send(null);
		
		return
	}

function SetValuesTesti(data)  
	{
           a questo punto non riesco ad accedere ai dati anche dopo numerevoli tentativi
        }

json.png

Grazie per l'aiuto
 
risolto. Mi sono accorto di un errore nella seguente funzione:

Codice:
function loadXMLTesti(form_tag, funzione, server, user, passw, nr)
	{
		var xURL = "characteristics.php?funzione="+funzione+"&server="+server+"&user="+user+"&passw="+passw+"&nr="+nr;
    
		GetDataArray("", xURL); // errore era GetData("", xURL); il parse non veniva fatto
		return
	}
 

Discussioni simili