-
12 Mar 2012 1:42 AM #1
Unanswered: "Ext.util.JSONP.request" fire only once
Unanswered: "Ext.util.JSONP.request" fire only once
Hi,
I make a JSONP request using Sencha touch, but it fires only onle. If I try to make a second call nothing appends. The name of the callback function can not be changed for information
Here is my code :
YAHOO.Finance.SymbolSuggest.ssCallback = function(data) {
console.log(data);
};
urly='http://d.yimg.com/autoc.finance.yahoo.com/autoc';
req = function() {
Ext.util.JSONP.request({
url: urly,
callbackKey: 'callback1',
params: {
query: 'yahoo',
callback: 'YAHOO.Finance.SymbolSuggest.ssCallback'
},
callback1: function(result) {
console.log('ok');
}
});
}
Thanks for help
-
1 May 2012 7:35 AM #2
Same issue here. Only fires the first time.
Same issue here. Only fires the first time.
Did you every figure this out? I have the same issue.
My code works perfectly the first time. But the JSONP request won't call again unless I reload the whole page/app in the browser. (in my case I'm inserting ads in various places in a list.)
I've inserted console.logs all over the place to verify things like function called, url is correct, etc.
Everything is happening correctly EXCEPT the actual JSONP call doesn't happen after the first time.
I can see from the Network tab in the Inspector that the call isn't happening. Ideas/Suggestions are greatly appreciated. Thanks.
Code:tpl: new Ext.XTemplate(MH.classes.Tpls.guysGrid, { compiled: true, adLink: function(index) { console.log('adLink called: ' + index); var randomNumber = Math.floor((Math.random() * 30) + 1); var adUrl = mhUrls.getAds + "fc.php?script=obMobile:JSON&zoneid=142&callback=callback&rand=" + randomNumber; console.log("adUrl: " + adUrl); Ext.util.JSONP.request({ url: adUrl, scope: this }); console.log('adLink complete: ' + index); } }), ... function callback(data) { console.log("returned: " + data.html); Ext.DomHelper.insertHtml("beforeend", document.getElementById("adwrapper9"), data.html); }
-
2 May 2012 2:58 AM #3
The solution is : Ext.util.JSONP.current = undefined;
But i ended using ajax
-
7 May 2012 8:27 AM #4
Try This
Try This
Ext.data.JsonP.request({
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function (data) {
alert('Hiiiiiiiiii')
}
});Thanks,
Prashanth


Reply With Quote