【问题标题】:Omit Callback string in JsonP Sencha Touch在 JsonP Sencha Touch 中省略回调字符串
【发布时间】:2013-05-30 08:50:17
【问题描述】:

如何在使用JsonP sencha touch生成的url中省略参数回调?

例如

生成的网址

http://api.example.com/get_players?callback=Ext.data.JsonP.callback1

我想要的网址

http://api.example.com/get_players

我可以删除其他参数,如页面,使用配置代理中的此配置限制启动 int url:

proxy: {
   type: 'jsonp',

   pageParam: false, //to remove param "page"
   startParam: false, //to remove param "start"
   limitParam: false, //to remove param "limit"
   noCache: false, //to remove param "_dc"

   url:  http://api.example.com/get_players,
}

我可以在 url 中使用没有字符串回调的回调方法吗?谢谢!!!

解决方案

我不得不使用中间服务,因为 API 不适用于 jsonp。 JSONP 总是包含回调字符串。

【问题讨论】:

    标签: extjs parameters proxy callback jsonp


    【解决方案1】:

    我相信你需要一个 jsonp 的回调

    你可能想看看this question

    【讨论】:

    • 问题是我使用的api是验证参数,不允许回调参数。所以你不能使用带有 valde 参数的 api 的 sencha touch?
    猜你喜欢
    • 1970-01-01
    • 2012-05-26
    • 1970-01-01
    • 2012-05-05
    • 1970-01-01
    • 2013-05-20
    • 1970-01-01
    • 2013-04-24
    • 2012-09-05
    相关资源
    最近更新 更多