On Wed, Nov 19, 2008 at 9:42 AM, Al Musella, DPM
<[EMAIL PROTECTED]>wrote:

> I am new to ajax.. and my javascript isn't too hot either:)
>
> I am trying a simple lookup of a city and state given a zip code. I
> have it working if I just return a city as a string, but when I try
> to return a structure with a city and state  I get "undefined"
>
> Here is the code where I call the ajax function...
>
>
> <cfajaxproxy cfc="ajaxtest" jsclassname="ajaxproxy" />
> <script>
>      var myProxy = new ajaxproxy();
>
> function getcity() {
>   var zipcode= document.getElementById('zip').value;
>   var result = myProxy.ziptocitystate(zipcode);
>   document.getElementById('city').value=result.city;
>    document.getElementById('state').value=result.state;
> }
>
> </script>
>
>
>  What notation is used to access the structure?
> thanks
>

JavaScript is case-sensitive.  Structs are returned with key names in
uppercase.  Try result.CITY and result.STATE.

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315558
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to