从 android 手机的phonegap应用程序中的url解析json
嗨,朋友们,到目前为止,我只在 Android 本机应用程序中工作。我第一次尝试在 Android 设备的手机间隙中创建应用程序。
我想点击一个url
,然后我得到json
格式的返回数据。我不知道如何在 javascript
中编写代码来访问 URL 并获取返回数据。请通过提供一段代码或任何教程来帮助我点击网址并获取返回数据。从返回的数据中我需要进行 json 解析,请指导我在 javascript 中进行 json 解析。
请各位朋友帮帮我......
Hi friends so far i have been worked only in android native app. First time i am trying to create an app in Phone gap for android devices.
I want to hit an url
and there i get a return data in json
format. I dont know to write a code in javascript
to hit an URL and get back a return data. Please help me by giving a piece of code or any tutorial to hit an url and get the return data. From that returned data i need to do json parsing, pls guide me in json parsing in javascript
too.
Please help me friends......
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于您尝试使用 GET 还是 POST 发出请求。您只需要使用
JSONRequest
如果您尝试仅使用简单的 GET 请求,那么您的语法将如下所示:
如果您想使用 POST 并且需要发送一些信息,这里是例如:
It depends if you are trying to do a request using GET or POST. You just need to use
JSONRequest
If you are trying to just use a simple GET request then your syntax would look something like this:
If you are wanting to use POST and you need to send some information here is an example for that:
在phonegap wiki上有一个关于此的教程:
http:// wiki.phonegap.com/w/page/36868306/UI%20Development%20using%20jQueryMobile
这正是您正在寻找的:)
好运气好!
There is a tutorial of this on the phonegap wiki:
http://wiki.phonegap.com/w/page/36868306/UI%20Development%20using%20jQueryMobile
It just what you are looking for :)
Good Luck!