打电话岗位价值web服务使用jQuery Mobile或的PhoneGap [英] call and post value webservice with jquery mobile or phonegap

查看:134
本文介绍了打电话岗位价值web服务使用jQuery Mobile或的PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我德兴我的jquerymobile页,我与PhoneGap的Andr​​oid的原生做程序。它是工作,但在我的网页我有表,我必须获得一定的价值,之后我会送价值/数据和web服务。我怎样才能做到这一点?我研究有关,但我发现了一些文件,这些都是非常复杂和不工作。所以你有一些exapmle /样品?谢谢


解决方案

  $阿贾克斯({
    网址:PublishUrl,
    输入:POST,
    数据:JSON.stringify(POSTDATA)
    的contentType:应用/ JSON的;字符集= UTF-8,
    成功:函数(结果){
    },
    错误:函数(X,Y,Z){
        警报(x.responseText ++ x.status);
    }
});

POSTDATA = JSON格式数据
PublishUrl =网址,你需要拨打服务

这同样可以用来发布和打电话也一样,你可以通过你的成功块而改变类型为GET和循环

i desing my page with jquerymobile and i do native app for android with phonegap. it is working but in my page i have form and i have to get some value and after that i will send value/data with webservice. How can i do that ? i research about that but i found some documents these are so complex and not working. so do you have some exapmle/sample ? Thanks

解决方案

  $.ajax({
    url: PublishUrl,
    type: 'POST',
    data: JSON.stringify(postData),
    contentType: "application/json;charset=utf-8",
    success: function (result) {


    },
    error: function (x, y, z) {
        alert(x.responseText +" "+ x.status);
    }
});

postData = data in json format PublishUrl = url where you need to call the service

This same can be used to post and call too, you can change type to "GET" and loop through in your success block

这篇关于打电话岗位价值web服务使用jQuery Mobile或的PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆