- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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... } ;
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page