-
29 Jun 2009 4:14 AM #21
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
30 Jun 2009 1:24 AM #22Ext JS Premium Member
- Join Date
- Feb 2008
- Location
- SRC solution, Toulouse, FR
- Posts
- 17
- Vote Rating
- 0
empty json response
empty json response
Hello, a response (status code 200, content type app/json) returning nothing is treated like an error (due to syntax error thrown by Ext.decode to set responseJSON) and so failure callback is called.
Is it the expected behaviour ?
-
30 Jun 2009 3:33 AM #23
@jfa -- Yes, the working assumption is:
'if the JSON returned by the server is poorly structured or otherwise cannot be properly decoded -- an exception event is raised and/or the failure callback is invoked'.
Why would you send back nothing with a Content-type header of application/json (which implies it should be treated as such)?"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
30 Jun 2009 4:43 AM #24Ext JS Premium Member
- Join Date
- Feb 2008
- Location
- SRC solution, Toulouse, FR
- Posts
- 17
- Vote Rating
- 0
-
13 Jul 2009 10:09 PM #25
Ext 2.2.1, ext-basex 3.5
Hi,
Just trying basex for the first time. (pop!)
I'm using it (or hoping to) for cross domain calls; I built a JSONP method on my server and did a simple example to prove the concept.
My callback never gets called. Any suggestions for debugging this?
When I watch it in firebug it seems to start OK. Basex passes parameter:Code:Ext.Ajax.request({ url: this.requestUrl, method: this.requestMethod, success: this.handleSuccess, failure: this.handleFailure, headers: headers, params: loginTokenParams, isJSON: true, proxied: { debug: true, callbackParam: 'callback' }, callback: function(options, success, response) { alert('the callback was called'); }, scope: this });
And the server responds appropriately I think; it is using content type application/x-javascript which seems to be a limitation of Jersey (Java based REST framework):Code:callback: basexCallback0
But no callback ever occurs.Code:basexCallback0({"partyId":"3"})
-
13 Jul 2009 10:19 PM #26
See the Flickr Ajax call on this demo page.
(And, download the latest zip again. it was updated just moments ago.)"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
14 Jul 2009 12:36 AM #27
there's something funky with the Ext.clone() method from ext-basex SVN rev. 58.
try this:
then log the contents of a in Firebug.Code:a = Ext.clone({ myFn: function() { return 'woohoo!'; } }, true); // true to perform a deep clone
you'll see that myFn has been mysteriously transformed from a Function into an Object.
[edit]
workaround:
deep cloning starts to work correctly if Ext.clone() has been invoked at least once.
i.e.
Code:Ext.clone(); // invoke Ext.clone() once a = Ext.clone({ myFn: function() { return 'woohoo!'; } }, true); // true to perform a deep clone
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
14 Jul 2009 6:38 AM #28
I wasn't able to get it working with ext-basex 3.5, but 3.4 is working fine with the original code I posted.
I'm still in the dark ages of ExtJS 2.2.1 if that explains anything.
-
14 Jul 2009 6:43 AM #29
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
14 Jul 2009 8:23 AM #30
One more issue: I pass an array of request headers, this was working as expected with plain Ext.lib.Ajax.
With ext-basex my headers are not included in the request. This one isn't a proxied request.






Reply With Quote