I tried to get value of variable from function beyond it, but always get error: Uncaught ReferenceError: devuuid_raw is not defined
The task is: I need to get value of variable beyond function in another variable because that value need to be used further (send to the server).
Code:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("Device is ready");
var element = document.getElementById('devProps');
devuuid_raw = device.uuid;
return devuuid_raw;
element.innerHTML = 'Идентификатор устройства: ' + device.uuid + '<br />';
}
var devuuid = devuuid_raw;
How can I get device.uuid value outside the function?