【问题标题】:the alert function in phonegap program does not work in the android emulatorphonegap 程序中的警报功能在 android 模拟器中不起作用
【发布时间】:2013-01-28 21:04:13
【问题描述】:
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!!!

【问题讨论】:

    标签: android android-emulator cordova alert phonegap-plugins


    【解决方案1】:
    if (networkState == Connection.NONE)
    {
      alert('No internet connection ');
     };
    

    【讨论】:

    • 某人....请回复...并给我一个解决这个问题的方法.......现在,我意识到我的程序有问题...
    • 有人可以帮我解决这个问题吗..我已经尝试了与phonegap.com中的完全相同的方法,但是在我设置环境变量之后……测试我在cmd中键入ant时得到的结果是一个错误的命令....请帮助
    • 我已经找到答案了......我犯的错误是......
    猜你喜欢
    • 1970-01-01
    • 2021-01-03
    • 1970-01-01
    • 2013-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多