Ubuntu Pastebin

Paste from try at Wed, 15 Jul 2015 17:16:57 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 Button {
                id: requestXML
                           objectName: "requestXML"
                           onClicked: {
                            text: i18n.tr( sendRequest())

                           }
                           function sendRequest() {
                                   var ajax = new XMLHttpRequest();
                                   ajax.onreadystatechange = function() {
                                       if (ajax.readyState === XMLHttpRequest.DONE) {
                                           console.log("ajax.status: " + ajax.status);
                                           if (ajax.status === 200) {
                                               console.log("Response = " + ajax.responseText);
                                           } else {
                                               // This is very handy for finding out why your web service won't talk to you
                                               console.log("Status: " + ajax.status + ", Status Text: " + ajax.statusText);
                                           }
                                       }
                                   }
                           //        var url = "http://192.168.1.106:8080/user_timeline.json?include_entities=true&include_rts=true&screen_name=ladygaga";
                                   var url = "http://localhost/TOSWEB/webservice/service.php";
                                   ajax.open("GET", url, true); // only async supported
                                   ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
                                   ajax.send();
                       }
            }
Download as text