Wednesday, September 30, 2015

Intel XDK - Device load function

While working on apps, many a times we need to take certain decisions when app is ready during app initialization. this can be done in init-aap.js file.

below sample code is written to add Device.Ready function to do something when app is executed.


document.addEventListener("app.Ready", app.initEvents, false) ;
document.addEventListener("intel.xdk.device.ready",function(){
    var value = intel.xdk.cache.getCookie("mobilenum");
    if(!value)
    {
        alert("no");
    }
    else
    {
        alert("yes");
        $(":mobile-pagecontainer").pagecontainer("change", "#aasReg", { reverse: false});
    }

},false);

 

No comments: