Ciao ragazzi, ho un problema..
Praticamente, ho una pagina php che effettua una chiamata AJAX a un'altra pagina php, che a sua volta restituisce un oggetto JSON.. e fin qui tutto ok, il problema è che poi quella richiesta JSON viene vista come testo semplice (giustamente), e non come Json.

Il codice che stò usando per la prova è:

Codice PHP:
//codice js che effettua la richiesta:
var x = 0;
var myRequest = new Array();
function CreateXmlHttpReq(handler) {
    var xmlhttp = null;
    try {
        xmlhttp = new XMLHttpRequest();
    }catch(e){
        try{
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    xmlhttp.onreadystatechange = handler;
    return xmlhttp;
}
function prova(){
    x++;
    var r = Math.random();
    myRequest[x] = CreateXmlHttpReq(function() {myHH(x)});
    myRequest[x].open("GET","test-json-02.php?r=" + escape(r));
    myRequest[x].send(null);
}
function myHH(x) {
    if (myRequest[x].readyState == 4 && myRequest[x].status == 200) {
        mySo = myRequest[x].responseText;
        alert(mySo); //e qui si vede che la richiesta viene ricevuta correttamente
        var myJson = json_parse(mySo); //funzione json_parse: [url]http://www.JSON.org/json_parse.js[/url]
        //qui si blocca e non và più avanti!!
        
    }
}


//pagina php che restituisce il json:
<?php
header
('Content-Type: application/json');
echo 
'
{
    "shipping":
        {
            "azienda": "nomeAzienda",
            "indirizzo": "via dei test n.1",
            "cap": "00000",
            "localita": "area di test",
            "provincia": "TS",
            "nazione": "Italia",
            "telefono": "0000-00000"
        },
    "company":
        {
            "codice": "000000",
            "azienda": "nome_azienda",
            "indirizzo": "via sdei test n.2",
            "cap": "00001",
            "localita": "Test area",
            "provincia": "TE",
            "piva": "0000000000000",
            "fiscale": "2222222222222",
            "telefono": "0000-000002",
            "fax": "5555-555555",
            "cellulare": "0000000000",
            "nome": "Test",
            "cognome": "Area"
        }
}'
;
Dov'è che sbaglio?
Ho anche provato a usare jQuery, con la funzione getJSON:
Codice PHP:
function prova2(){
    $.
getJSON("test-db-02.php", {"a""b"}, function(dati){
        
alert('...');
        
alert(dati);
    });

Ma niente.
Aiuti?