# Ajax return value is assigned to a global variable solution sessionStorage
While ajax js-valued value to a global variable, the global variable is less than the acquisition, ajax default is asynchronous, synchronous can of course be changed assignment, but a better solution is to use ajax sessionStorage to hold the value obtained in you can get anywhere globally.
sessionStorage.setItem ( 'testKey', 'which is a value test value');
sessionStorage.getItem('testKey');