Software Archive
Read-only legacy content
17061 Discussions

Button Clicks/ Events do not work

Markus_W_1
Beginner
266 Views

Hello, 

I'm new to this and I try to build an app.

This is in my index.html header:

        <script src="intelxdk.js"></script>
        <script src="cordova.js"></script>
        <script src="xhr.js"></script>
        <script src="xdk/init-dev.js"></script>
        <script src="js/app.js"></script>
        <script src="js/init-dev.js"></script>
        <script src="js/init-app.js"></script>

And this in my init-app.js:

app.initEvents = function () {
    "use strict";
    var fName = "app.initEvents():";
    app.consoleLog(fName, "entry");

    app.initDebug();           // just for debug, not required; keep it if you want it or get rid of it
    app.hideSplashScreen();    // after init is good time to remove splash screen; using a splash screen is optional

    $(".quitApp").bind("click", exitFromApp); //Click on exit button

    $("#refreshWeather").bind("click", getWeatherData); //Click on "refresh weather"
    document.addEventListener("intel.xdk.device.remote.data", getRemoteDataEvent, false); //refresh the data

    document.addEventListener("backbutton", exitFromApp, false); //also quit app when pressing back button

    app.consoleLog(fName, "exit");
};

So and a part of the app.js:

function exitFromApp()
{
    navigator.app.exitApp();
}

Everything else is just standard setting. My problem is, that when testing in Emulator or Testing onnmy real device, nothing happens on Back Button or when clicking the Exit Button. Did I forget something? I'm really confused.

Thanks for help. 

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
266 Views

You're using jQuery but have not included the jQuery library in your app. You need to download and add it to your app and then make sure to include it in the list of JS libs you include in your index.html file.
 

0 Kudos
Reply