我新的在电话沟通,我想开发一个phonegap应用程序的
android ..我想给一些功能按钮点击我的html ..我已经尝试过这个代码,但它不起作用:
的index.html
<!DOCTYPE HTML> <html> <head> <title>PhoneGap</title> <script type="text/javascript" charset="utf-8" src="phonegap.js"></script> <script type="text/javascript" charset="utf-8" src="mycode.js"></script> </head> <body onload="init();> <h1>Hello World</h1> <form> <input type="button" value="Click me" onclick="msg()" /> </form> </body> </html>
mycode.js
function init() { // the next line makes it impossible to see Contacts on the HTC Evo since it // doesn't have a scroll button // document.addEventListener("touchmove",preventBehavior,false); document.addEventListener("deviceready",deviceInfo,true); } function msg() { alert("button clicked"); }
有谁知道如何解决我的问题?感谢之前..