Passing a variable from a callback function to another function?
问题 I am working on setting up an HTML5 GeoLocation script and I would like to store the zip code in a cookie but for now I am just trying to figure out how to pass the zip code variable into another function. Here is my script to reverse geo-code based on lat/long: function retrieve_zip(callback) { try { if(!google) { google = 0; } } catch(err) { google = 0; } // Stupid Exceptions if(navigator.geolocation) // FireFox/HTML5 GeoLocation { navigator.geolocation.getCurrentPosition(function(position)