My code is like this and I'm trying to fill a form field with the result of the jQuery function. But it's not working. What am I doing wrong here? It logs the result to the console fine, including the hash and the array:
jQuery(document).ready(function() {
    new GetBrowserVersion().get(function(result, components){
        console.log(result); //a hash
        console.log(components); //an array
    });
    var unique_id = result;
    $('#unique_id').val(unique_id);      
 });
What I get is this:
Uncaught ReferenceError: result is not defined
Followed by the hash and array.
 
     
     
    