Using Extjs 3.4, I am working on a simple ajax request:
Ext.Ajax.request({
url: "localhost:3000/offers.json",
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
console.dir(obj);
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
The localhost:3000/offers.json is powered by Rails 4 back-end and it is functioning correctly:
$curl localhost:3000/offers.json
[{"id":1,"desc":"a description","img_link":"www.google.come","product_link":"www.google.come","code":"927341","price":"20.29","special_price":"13.99","saving":"31.0","created_at":"2014-06-23T15:45:11.404Z","updated_at":"2014-06-23T15:45:11.404Z"}]
So the back-end appears to be working without any issues.
However, when trying to call the json url using Ext.Ajax.request
, an error pops up in the Chrome console:
OPTIONS localhost:3000/offers.json net::ERR_UNKNOWN_URL_SCHEME ext-base.js:21
i ext-base.js:21
Ext.lib.Ajax.k.request ext-base.js:21
Ext.extend.request ext-all-debug.js:4636
ajaxSearch_function grid-ajax.js:8
Ext.Button.Ext.extend.onClick ext-all-debug.js:31872
h ext-all-debug.js:5215
server-side failure with status code 0
Any thoughts or suggestions on how to address this issue?