-
15 Nov 2007 9:39 AM #11
Sorry for my English.
I understand.
I try to change by easy way this code:
for this:Code:script.setAttribute("type", "text/javascript");
I have no errors, but "handleresponse" never fires.Code:script.setAttribute("type", "text/xml");
Is posible by changes in your override code, proccesing the two most popular types of reponses in client? (JSON and XML). Now only processing JSON?
I think that your override should be included in future versions of Ext. The cross-domain request are in the top of actual web applicattions.
Thanks in advance,
-
15 Nov 2007 11:26 AM #12
Im trying to use the override too. I am able to run the example just fine, but when i run my own application code i get the following error in fireBug which says invalidLabel? Anyone have any ideas? Thanks!
-
15 Nov 2007 12:22 PM #13Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Forest Grove, OR
- Posts
- 1,038
- Vote Rating
- 0
What does your response look like?
Jeff Howden
Ext JS - Support Team Volunteer
jeff@extjs.com
Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.
Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.
-
15 Nov 2007 12:43 PM #14
Here is my response:
[IMG]chrome://firebug/content/blank.gif[/IMG]{"status":"success","connectionId":"6F2A9B03326B26DC"}
Also, I missed this earlier, but i guess my response has to be wrapped in a callback function. If this is the case, it seems i have to set this up on the server so my response should be:
myCallBack ('{"status":"success","connectionId":"6F2A9B03326B26DC"}')
This ok when i have control of the server response, but about the case where I am accessing data from a server whihc is out of my control. Please correct me if I'm not understanding this correctly. Thanks.
-
15 Nov 2007 12:56 PM #15
oops my original response string was:
{"status":"success","connectionId":"6F2A9B03326B26 DC"}
Thanks...
-
15 Nov 2007 1:44 PM #16
Animal. Will this work with the 1.1.1 release?
Thx
-
15 Nov 2007 3:08 PM #17Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Forest Grove, OR
- Posts
- 1,038
- Vote Rating
- 0
That's correct. A callback is absolutely necessary. The reason is that you're just dynamically including a JavaScript file and without the response wrapped with a function call there's no way for the response to get injected back into whatever it is you need to have it in. Additionally, without it being wrapped in a callback, the response (whether pure JSON or XML) will cause errors as it's invalid JavaScript on its own.
If the server response is out of your control, often there are means for instructing the server (by the parameters sent to it) to include a callback. In some cases you can specify the name of the callback function. In others, the callback is not adjustable and you must indicate in your request parameters what the name of the callback will be so Ext can setup a function by that name that's waiting to be called. In situations where there's no means for the server to include a callback, you'll have to proxy the request from your server to their server and back.Jeff Howden
Ext JS - Support Team Volunteer
jeff@extjs.com
Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.
Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.
-
15 Nov 2007 11:15 PM #18
-
16 Nov 2007 8:08 AM #19
I`m using Animal`s override and able to get the callback from the server.
Can I use script tag the same as normal AJAX calls in the sense that I can make two asynch requests?
I`m creating two connections objects con1 and con2.
Requests are being sent as a result of user actions.
There could be a state where both con1 and con2 are running so before I`m making a request I`m doing a check:
It takes 30 seconds for my server to respond so I can easily control things.Code:if(!con1.isLoading()) { con = con1; console.log('con1'); return true; } else if(!con2.isLoading()) { con = con2; console.log('con2'); return true; } else return false;
When looking at firebug console and sending requests with a delay time < 30 second I get:
Instead of:Code:con1 con1 con1 ...
Is there a problem with isLoading() with this override or maybe I`m not allowed to use it?Code:con1 con2 con1 con2 ...
I tried the same with normal AJAX calls and I get the expected behaviour.
Is timeout the only error exception I can get when using script tag?
-
18 Nov 2007 9:40 AM #20
This works.
The server MUST respond by calling the specified callback to get the data "into" Ext.
Here is what I am hoping (probably somewhat pretentiously) will become a "reference implementation" of Ext with cross-domain Ajax. It's a Flickr control Panel.
It's not finished, but try it as far as it goes. It's commented, so you should be able to see what it does. It unzips into examples/<whatever>
flickr.zip
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642


Reply With Quote

