1
now,the problem i am facing when i run the project in the LogCat

1 TAG-Trace TEXT-error opening trace file:no such file or directory found (2)

当我单击定义了 onclick 函数的文本时,我没有得到任何错误状态

2 TAG-web 控制台 TEXT-uncaught Typeerror:cannot call the method 'alert' of undefined at file:///android_assets/www.index.html:27

navigator.notification.alert(

我的编码是

    <html>
  <head>


    <script type="text/javascript" charset="utf-8" src="cordova-2.4.0.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for Cordova to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // Cordova is ready
    //
    function onDeviceReady() {
        // Empty
    }

    // alert dialog dismissed
    function alertDismissed() {
        // do something
    }

    // Show a custom alertDismissed
    //
    function showAlert() {
        navigator.notification.alert(
            'You are the winner!',  // message
            alertDismissed,         // callback
            'Game Over',            // title
            'Done'                  // buttonName
        );
    }

    </script>
  </head>
  <body>
    <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
  </body>
</html>

in the case of the Accelerometer project nothing comes except whatever is given in the paragraph tag...where would i have committed mistake...i have no idea about it.

**i have tried with almost all the examples but the alert function does not function**


**i have tried both ways trying out with the example and then by copying all the files like the jar,cordova.js,xml and cordova folder**

now what should i do??? please help!!!
4

1 回答 1

0
if (networkState == Connection.NONE)
{
  alert('No internet connection ');
 };
于 2013-02-13T10:51:43.147 回答