storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsha <st...@harsha.io>
Subject Re: Ajax Cross-Domain Request in Javascript
Date Mon, 01 Dec 2014 16:59:05 GMT


callback param only works in 0.9.3 we don't have it in 0.9.2 and the url
should be http://server:port/api/v1/cluster/summary?callback=foo than
the response will be wrapped in foo(repsonse_json) -Harsha

On Mon, Dec 1, 2014, at 08:47 AM, Jose Juan Martinez wrote:
> Thanks,
>
> I use storm 0.92, I'll try with version that you say.
>
> In 0.92 version add ?callback param:
>
> $.ajax({ url: 'http://server:port/api/v1/cluster/summary?callback=?,
> dataType: 'jsonp', success: function(response) { console.log('Data OK
> ... '); }, error: function(xhr, status, error) { console.log('Status:
> ' + status); console.log('ERROR: ' + error); console.log('InText: ' +
> xhr.responseText); } });
>
> The response is the same error that before, How can I pass the
> callback param in this version?
>
> 2014-12-01 17:23 GMT+01:00 Harsha <storm@harsha.io>:
>> __
>> which version of storm are you using? . In storm 0.9.3 we added jsonp
>> support
>>
>> you can pass "callback" query param to the REST Api.
>>
>> -Harsha
>>
>>
>>
>> On Mon, Dec 1, 2014, at 07:51 AM, Jose Juan Martinez wrote:
>>> Hello,
>>>
>>> I need to get data from Storm Rest UI, for example,
>>> http://server:port/api/v1/cluster/summary through ajax cross-domain
>>> request in javascript. My code is the next:
>>>
>>> $.ajax({ url: sUrl, dataType: 'jsonp', success: function(response) {
>>> console.log('Data OK ... '); }, error: function(xhr, status, error)
>>> { console.log('Status: ' + status); console.log('ERROR: ' + error);
>>> console.log('InText: ' + xhr.responseText); } });
>>>
>>> And the response is: "Status: parsererror" storm.js:66 "ERROR:
>>> Error: jQuery211012710382721385483_1417447726524 was not called"
>>> storm.js:67 "InText: undefined"
>>>
>>> How can i do a ajax cross-domain request in javascript?
>>>
>>> Thanks
>>
>


Mime
View raw message