Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Paolo_p_3
Beginner
22 Views

script not runXDK HTML5 CORDOVA

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

Tags (2)
0 Kudos
1 Reply
PaulF_IntelCorp
Employee
22 Views

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...
} ;

 

0 Kudos