HTTP methods in PhoneGap

早过忘川 提交于 2019-12-03 21:45:52

Well you can use what Andrew wrote as there is no reason why you can't just get the html code instead of JSON from the remote url. You can use jQuery to do the GET but if you don't need to add that library you can just use straight XHR.

Here is a quick tutorial I wrote:

http://simonmacdonald.blogspot.com/2011/12/on-third-day-of-phonegapping-getting.html

On the line:

var tweets = JSON.parse(request.responseText);

you would just do:

var myBody = request.responseText;

as it would be the full HTML of the page you requested.

I think jQuery would be your best option. PhoneGap does not provide anything to make GET requests. It's main role is to allow your HTML/JS application to access native resources.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!