function makeRequest() {
httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function () {
getProduct(httpRequest);
};
url = 'test.php';
httpRequest.open('POST', url, true);
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpRequest.send(null);
}
function getProduct(httpRequest) {
var jsonText = httpRequest.responseText;
jsonText = jsonText.json;
document.write(jsonText.one);
}
Как?