我是手机应用程序开发的新手。测试应用程序对我来说是个大问题,因为我没有任何设备可以测试它所以我只是通过禁用{{}来尝试将事件测试到浏览器firebug
1}}启用onDeviceReady
时的功能。
这是jquery中的代码..
$(document).ready(function(){
在上面的代码中,我能够看到按钮点击事件的触发,但无法在firebug //Add event listener to run when the device is ready
// document.addEventListener("deviceready", onDeviceReady, false);
//Device is ready
// function onDeviceReady() {
$(document).ready(function(){
$('#call').bind('click',function(){
senddata();
});
});
// }
function senddata(){
var empname=$("#name").text();
alert(empname);
var contactno=$("#contact").text();
alert(contactno);
//Webservice URL
var URL="index.html";
$.ajax({
url: URL,
data: "",
type: 'POST',
success: function (resp) {
alert(resp);
},
error: function(e) {
alert('Error: '+e);
}
});
}
交通中看到ajax调用URL。是否有任何错误。
我试图采用的方式来测试手机应用程序是正确的还是错误的方式..请帮帮我.. 谢谢,,。