问题
This is what I'd like to do:
navigator.geolocation.getCurrentPosition( wallEventByCat( variable, position ), handle_errors );
in order to have this kind of callback:
function wallEventByCat( position, category )
{
}
Is this doable ? if yes, how ?
Thanks
回答1:
You should use an anounymous function like:
navigator.geolocation.getCurrentPosition( function(position){
wallEventByCat( variable, position );
}, handle_errors );
来源:https://stackoverflow.com/questions/22032361/how-to-pass-a-second-parameter-to-geolocation-success-function