Hello a have a problem with my javascript. Can you help me? Thank everybody.
When I have:
var url = "http://naucse-python.now.sh" // error -> Redirect to http://naucse-python.now.sh/ (308)
var url = "https://naucse-python.now.sh" // nothing is displayed
When I have:
var url = "http://jsonplaceholder.typicode.com/todos/1" // everything is OK
var url = "https://jsonplaceholder.typicode.com/todos/1" // nothing is displayed
// main.qml
import bb.cascades 1.4
Page {
function sendRequest() {
var xhr = new XMLHttpRequest();
var url = "http://naucse-python.now.sh"
//var url = "http://jsonplaceholder.typicode.com/todos/1"
xhr.onreadystatechange = function() {
//if (xhr.readyState === XMLHttpRequest.DONE) {
//if (xhr.status === 200) {
console.log(xhr.responseText);
textArea.text = xhr.responseText;
//}
//}
};
xhr.open("GET", url, true);
xhr.send();
}
Container {
TextArea {
id: textArea
}
}
onCreationCompleted: {
sendRequest()
}
}