Phonegap / Javascript应用程序:如何存储cookie? [英] Phonegap/Javascript App: how can I store cookies?

查看:95
本文介绍了Phonegap / Javascript应用程序:如何存储cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在探索为平板电脑编写一个javascript应用程序的想法,该应用程序将读取一个个性化的新闻网站(我不拥有)。我想让用户登录,以便他们可以看到他们的内容,但我不知道用JavaScript处理登录Cookie的方式(即存储和重新发送它们在每个请求)。

I am exploring the idea of writing a javascript app for tablets which will read a personalized news site (which I do not own). I want to have the users login so they can see their content, but I don't know of a way to handle login cookies with javascript (ie store and resend them on each request).

这是可能的,通过写一些类型的接口到本地cookie存储与Phonegap?

Is this possible to do by writing some kind of interface to the native cookie store with Phonegap?

我感谢任何帮助。

推荐答案

PhoneGap不提供任何cookie抽象,因为有很多其他工具可以做到这一点(Phonegap只是包装智能手机功能,而不是基本的浏览器功能)。

Phonegap does not provide any cookie abstraction, as there are plenty of other tools to do that already (Phonegap just wraps up smartphone functionality, not basic browser functionality).

如果你愿意使用jQuery,你可以试试这个 jquery-cookie插件,我已成功使用它自己。

If you're willing to use jQuery, you may want to try this jquery-cookie plugin, I've used it successfully myself.

这篇关于Phonegap / Javascript应用程序:如何存储cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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