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);
Parsing JSON
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
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio