I don’t get response from specific url using xmlhttprequest
I don’t get response from specific url using xmlhttprequest
BY 07 Dec 2018Web Application Development
Hi I tried to get the response from strava.com but it doesn’t return nothing, the status for this is 0. When I tried to get response from google.com it works. the strangest about this, is it worked yesterday but now it doesnt work anymore, also when I try to navigate strava.com with opera it works, I dont understand.
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
//this.responseText
alert(this.responseText);
}
};
xhttp.open("GET", "https://www.strava.com/login", true);
//xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhttp.send();
}
I also noticed that the domParser doesn’t work in my app or did I do something wrong?
function getToken(html){
var parser = new DOMParser();
var parsedHtml = parser.parseFromString(html, 'text/html');
var x = parsedHtml.getElementsByName("csrf-token")[0].content;
return x;
}
it works great in my browser but not on tizen 2.2 wearable, is there any other way to get the csrf token I tried regex but it matches more than csrf token only.
I don’t get response from specific url using xmlhttprequest
Hi I tried to get the response from strava.com but it doesn’t return nothing, the status for this is 0. When I tried to get response from google.com it works. the strangest about this, is it worked yesterday but now it doesnt work anymore, also when I try to navigate strava.com with opera it works, I dont understand.
My privilege:
my Code:
I also noticed that the domParser doesn’t work in my app or did I do something wrong?
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio