set outer scoped variable from inner scope in javascript
<pre><code>var lat = 0.0;
var lng = 0.0;
var jsonData = null;
var geocoder = new google.maps.Geocoder();
var miles = $('#milesAway').val();

// find what the user is locating by
if ($('#zipCode').is(':visible'))
{
    var zipText = $('#zipCode').val();
    if (isValidUSZip(zipText))
    {
        geocoder.geocode( {
            'address': zipText
        }, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                lat = results[0].geometry.location.lat();
                lng = results[0].geometry.location.lng();
                map.setCenter(results[0].geometry.location);
            } else {
                alert("Zip Code couldn't be located.");
            }
        });
    }
    else
    {
        alert('Please enter a valid US zip code.');
    }
}
</code></pre>

<p>lat and lng are still set as 0.0 after this thing runs through, why? Shouldn't I be able to set these like this?</p>

<p>Edit: I get to the point where they are supposed to be set too, if I put an alert there I can see the values that they are supposed to be set to.</p>
