// In the Components array:
{
name: "webService",
kind: "WebService",
url: "http://blockchain.info/ticker",
onResponse: "webServiceResponse",
onError: "webServiceError",
},
// ...
Console output: [17:18:54.696] webServiceError: 0
rendered: function() {
this.inherited(arguments);
this.$.webService.send({ jsonp: true });
},
webServiceResponse: function(inSender, inEvent) {
enyo.log("webServiceResponse: "+inEvent.data);
enyo.log(inEvent.ajax);
},
webServiceError: function(inSender, inEvent) {
enyo.log("webServiceError: "+inEvent.data);
enyo.log(inEvent.ajax);
},
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The underlying issue might be due to cross-domain origin restrictions. You can verify this by putting your app source up on the same domain and accessing it online.
If you're developing with Chrome, make sure you have at least the --disable-web-security flag set to eliminate the cross-domain check.
Thanks
P.S. If that's possible. Otherwise I need to find another way
1st: Add systemXHR to the manifest.webapp (FirefoxOS): 2nd, you need to edit the function "getXMLHttpRequest" of the xhr.js file (enyo.xhr kind). You need to add { "mozSystem": true }. The enyo team should edit the method and write another if that checks if you're working with ffOS. If so, return new XMLHttpRequest({ "mozSystem": true }); else, return the "standard" (empty constructor). I'm not a professional here but I guess that would be the best solution?
For users of the high-level API enyo.Ajax, there is still no way to set this option, though, as far as I can see:
The option mozSysteme needs to be set as a top-level entry in the options hash like this:
enyo.xhr.request({mozSystem: true})
However enyo.Ajax.request doesn't allow to add new top-level entries to the parameters when calling enyo.xhr.request - see https://github.com/enyojs/enyo/blob/2.4.0/source/ajax/Ajax.js#L133