-->

JSONP request issue with Sencha Touch 2.1.1

2019-08-30 09:07发布

问题:

According to Sencha Touch 2.1 documentation, you make a json request with the following method Ext.data.JsonP.request(). When I use it I get: "Uncaught TypeError: Cannot call method 'request' of undefined". I get the same error whith Ext.util.JSONP.request().

How to make a jsonp request with Sencha Touch 2.1.1 ?

回答1:

I guess you have not imported required classes. To work with Ext.data.JsonP.request, you need to add a require like requires:['Ext.data.proxy.JsonP'] in corresponding class. I simply prefer to add require inside app.js itself.