私のコードはこのようなもので、jQuery関数の結果をフォームフィールドに入力しようとしています。しかし、それは動作していません。私はここで間違って何をしていますか?それは、ハッシュと配列を含む、コンソール罰金に結果をログに記録します。jQueryで取得した変数はどのように使用しますか?
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);
});
私は何を得ることはこれです:
ハッシュと配列が続くUncaught ReferenceError: result is not defined
。
[非同期呼び出しからの応答を返す方法](http://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an) -asynchronous-call) –