Variable becomes Nan when i try to use it outside of the .each function
问题 I'm grabbing a JSON obj from an external source. It appears as so: {"total":16231642,"totalamount":437442282.55} I set it as a global var, set it in the each function and then try to retrieve it outside of it, below. But i get a Nan as the value. The value is deifinitely being set in the function so i am not entirely sure why this is happening. Any help is appreciated! $( document ).ready(function() { var todaystart; //Get vals from JSON txt $.getJSON( "proxy.php", function( data ) { $.each