Parsing JSON

Parsing JSON

BY 24 Apr 2014 Web Application Development

Hello

I have a probleme when i try to parse JSON prom php page with XHR 

this is my html page

<input name=”myBtn” type=”submit” value=”Submit Data” onClick=”javascript:ajax_post();”>
<br />
<div id=”status”></div>

JavaScript

function ajax_post(){

    var reviver;
    var hr = new XMLHttpRequest();
    document.getElementById(“status”).innerHTML = “processing…1”;
    var url = “http://quotesconsommationesprit.azurewebsites.net/json/json.php”;
    document.getElementById(“status”).innerHTML = “processing…2”;
    hr.open(“GET”, url, true);
    
    document.getElementById(“status”).innerHTML = “processing…3”;
    hr.setRequestHeader(“Content-type”, “script/json”);
    
    document.getElementById(“status”).innerHTML = “processing…4”;
    hr.onreadystatechange = function() {
        if(hr.readyState == 4 && hr.status == 200) {

            document.getElementById(“status”).innerHTML = “processing…7”;
            var return_data = JSON.parse(  hr.responseText, reviver);
            document.getElementById(“status”).innerHTML = return_data.citation[0].id;
        }
    }
    document.getElementById(“status”).innerHTML = “processing…5”;
    hr.send(null);
    document.getElementById(“status”).innerHTML = “processing…6”;
    }

 when i run it with Tizen web Application and with Google Chrome, was stopped on “processing…6”

chrome  emulator  

but it work with the Tizen web Simulator application 

simulator 

and i added the access in the Policy 

where is the problem please 

Written by