在sencha touch中使用不同的参数重新加载JSONP请求
我从Sencha Touch学习中心的GeoTweets教程中获取了代码,效果非常好。我需要一个带有Submit按钮的表单,它向JSON服务器发送新的请求,并更改参数。有人能告诉我正确的方向吗?在谷歌上搜索了一下,但找不到任何与Sencha Touch相关的东西 以下是我提出的请求的代码:在sencha touch中使用不同的参数重新加载JSONP请求,json,sencha-touch,jsonp,Json,Sencha Touch,Jsonp,我从Sencha Touch学习中心的GeoTweets教程中获取了代码,效果非常好。我需要一个带有Submit按钮的表单,它向JSON服务器发送新的请求,并更改参数。有人能告诉我正确的方向吗?在谷歌上搜索了一下,但找不到任何与Sencha Touch相关的东西 以下是我提出的请求的代码: Ext.util.JSONP.request({ url: 'http://myserver/testdetails.php', callbackKey: 'c
Ext.util.JSONP.request({
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
});
};
我所要做的就是用新参数重新加载JSONP。只要有
var config = {
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
}
然后像这样改变参数
config.params = {q:"amused", rpp:20, uniqueify: Math.random()};
Ext.util.JSONP.request(config);
然后像这样提出请求
config.params = {q:"amused", rpp:20, uniqueify: Math.random()};
Ext.util.JSONP.request(config);
只要
var config = {
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
}
然后像这样改变参数
config.params = {q:"amused", rpp:20, uniqueify: Math.random()};
Ext.util.JSONP.request(config);
然后像这样提出请求
config.params = {q:"amused", rpp:20, uniqueify: Math.random()};
Ext.util.JSONP.request(config);