Good Morning,
I created an App with HTML5 and Cordova and I set a javascript function in the body onload but does not enter there.
I installed the last version of XDK and that work fine on old version.
this is extract of code not working
<body onload="inizia();" style="background-color: #ffffff">
<script>
function inizia() {
alert('1');
document.addEventListener("deviceready", onDeviceReady,false) ;
If I insert a alert direct in onload work corretly
<body onload="alert('1');" style="background-color: #ffffff">
I have move the script code in the head tag but the problem persist
Thanks
Link Copied
I'm assuming you are testing this in the Simulate tab. I recommend you use console.log() messages not alerts to test this. You might have a problem with the function definition. Try defining inizia() this way, instead:
var inizia = function() { ...your code here... } ;
For more complete information about compiler optimizations, see our Optimization Notice.