For some reason the newdata inside the get function is being lost when trying to use it outside the function. The alert shows 0, but when I put the alert in the get function it shows 80 (which is what it should be.) any ideas??
var newdata = 0;
//Get latest stat from file
$.get( "http://localhost/?stat=size", function( data ) {
//Strip any letters from result (if any)
newdata = data.replace(/\D/g,'');
//alert( "Load was performed."+newdata );
});
alert( "Load was performed."+newdata );
Thanks