在PhoneGap的项目警报功能不会在Android模拟器工作

编程入门 行业动态 更新时间:2024-10-23 23:26:17
本文介绍了在PhoneGap的项目警报功能不会在Android模拟器工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

现在,我所面临的问题,当我运行该项目在LogCat中

  

1的TAG-跟踪TEXT-错误打开跟踪文件:没有这样的文件或目录中(2)

当我点击为其的onclick函数的定义我没有得到任何的错误状态文本

  

2的TAG-Web控制台TEXT-未捕获类型错误:无法调用未定义的方法'警报'的文件:///android_assets/www.index.html:27

    

navigator.notification.alert(

我的编码是

< HTML和GT;  < HEAD>    <脚本类型=文/ JavaScript的字符集=utf-8SRC =科尔多瓦-2.4.0.js>< / SCRIPT>    <脚本类型=文/ JavaScript的字符集=utf-8>    //等待科尔多瓦加载    //    document.addEventListener(deviceready,onDeviceReady,FALSE);    //科尔多瓦准备就绪    //    功能onDeviceReady(){        //空    }    //警告对话框驳回    功能alertDismissed(){        // 做一点事    }    //显示一个定制alertDismissed    //    功能showAlert(){        navigator.notification.alert(            你就是赢家!',//消息            alertDismissed,//回调            '游戏结束',//称号            完成// BUTTONNAME        );    }    < / SCRIPT>  < /头>  <身体GT;    < P>< A HREF =#的onclick =showAlert();返回false;>显示警报< / A>< / P>  < /身体GT;< / HTML>在加速度计项目无关的情况下,除了自带无论是在段落标记...其中,我会犯的错误给予...我有没有关于它的想法。**我曾尝试与几乎所有的例子,但报警功能不起作用****我试图左右逢源尝试与榜样,然后通过复制所有文件,如罐子,cordova.js,XML和科尔多瓦文件夹**现在我应该做的?请帮忙!!!

解决方案

如果(networkState == Connection.NONE){  警报('没有互联网连接'); };

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

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

when i click on the text for which onclick function is defined i don't get anything the error states

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

navigator.notification.alert(

my coding is

<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!!!

解决方案

if (networkState == Connection.NONE) { alert('No internet connection '); };

更多推荐

在PhoneGap的项目警报功能不会在Android模拟器工作

本文发布于:2023-11-27 16:00:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638660.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:会在   模拟器   警报   功能   项目

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!