How to access javascript varibale which is set in jquery block?
<p>I've problem in javascript function, there are two variables which are declared in global scope of function and set within jquery plugin. How can i get these variable value out side of jquery.</p>

<pre><code> function GetDirectionFromCurrentLocation(StoreAddress) {
var positionStore = null;
var positionCurrent = null;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': StoreAddress }, function (results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
        positionStore = results[0].geometry.location;
    }
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function (position) {
            positionCurrent = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

        });
    }

});
window.open("http://maps.google.com/maps?saddr=" + positionCurrent + "&amp;daddr=" + positionStore + "&amp;hl=en&amp;output=html");
 }
</code></pre>

<p>These variables are always null. </p>
