无法在Phonegap应用程序中看到ajax调用URL

时间:2014-11-18 13:07:03

标签: android jquery ajax cordova

我是手机应用程序开发的新手。测试应用程序对我来说是个大问题,因为我没有任何设备可以测试它所以我只是通过禁用{{}来尝试将事件测试到浏览器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。是否有任何错误。

我试图采用的方式来测试手机应用程序是正确的还是错误的方式..请帮帮我.. 谢谢,,。

0 个答案:

没有答案