-
22 Mar 2009 10:50 AM #1
google gecoding service and cross domain requests
google gecoding service and cross domain requests
Hi,
I'm using google geocoding service as described here:
In the example the url for the request is:
and the response:Code:http://maps.google.com/maps/geo?output=json&...&callback=_xdc_._1fsm2u0k2
I understand how cross domain requests and ScriptTagProxy works but I don't understand why google respond with:Code:_xdc_._1fsm2u0k2 && _xdc_._1fsm2u0k2({ "name": "1600 Amphitheatre Pky, Mountain View, CA", "Status": { ... ... ... } )
and not with:Code:_xdc_._1fsm2u0k2 && _xdc_._1fsm2u0k2({...
Any ideas?Code:_xdc_._1fsm2u0k2({...
Thanks
-
22 Mar 2009 11:26 AM #2
It's a truth test.
The statement will not execute unless _xdc_._1fsm2u0k2 exists
Type the following into the Firebug console:
thenCode:function f(){alert(1);}
You see that the function is not run.Code:undefined && f()
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
-
22 Mar 2009 12:21 PM #3
That's interesting.
Couldn't this improve the following code in scriptTagProxy:
In case of a timeout failure the check if the function exist is not necessary.Code:// private destroyTrans : function(trans, isLoaded){ this.head.removeChild(document.getElementById(trans.scriptId)); clearTimeout(trans.timeoutId); if(isLoaded){ window[trans.cb] = undefined; try{ delete window[trans.cb]; }catch(e){} }else{ // if hasn't been loaded, wait for load to remove it to prevent script error window[trans.cb] = function(){ window[trans.cb] = undefined; try{ delete window[trans.cb]; }catch(e){} }; } },
Could this be a feature request?
Thanks


Reply With Quote