Spotify 应用程序 - 维护页面之间的状态

发布于 2025-01-05 08:32:40 字数 216 浏览 2 评论 0原文

Firend 我正在开发 Spotify 应用程序和根据他们的开发者网站,我了解到我只能使用 HTML/HTML5、javascript、css 进行开发 现在我有一些关于开发的问题: 我有多个页面&对于每个页面,我都有特定的输入参数和我想在整个应用程序中跟踪这些参数 例如作为用户输入的用户名。 我怎样才能做到这一点, 有没有某种会话管理工具或类似的东西? 我如何处理来自不同页面的我的数据以显示所需的结果。

Firend i am developing spotify application & according to their developers site i come to understand that i can use only HTML/HTML5 , javascript, css for development
Now i am having some question regarding development:
I am having multiple pages & for each page i am having certain input parameters & i want to track these parameter throughtout application
such as user name taken as input from user.
How can i do that ,
is there any kind of session management tool or something like that?
How can i process mydata from different page to show desired result.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深者入戏 2025-01-12 08:32:40

根据 API 指南,您可以利用HTML localStorage API

您的应用程序将能够使用本地存储 HTML5 API,这是您的应用程序可用的有限空间(5 MB)。请注意,您在此处保存的任何状态都将是本地的,因此,如果用户在另一台计算机上登录 Spotify 并浏览到您的应用程序,您将无法从中恢复。
要恢复状态,无论用户当前使用哪台计算机,请使用您自己的后端。

有关如何与 localStorage 交互的综合文档可以在 MDC。

归结为使用 window.localStorage.setItem(key, value)window.localStorage.getItem(key) 来设置和检索数据。

As per the API Guidelines, you are able to take advantage of the HTML localStorage API:

Your application will be able to use the local storage HTML5 API which as a limited amount of space available to your application (5 MB). Please be aware that any state you save here will be local, and hence you won’t be able to restore from it if the user logs into Spotify on another computer and browses to your application.
To restore state regardless of which computer a user is currently using, please use your own backend.

Comprehensive documentation on how you can interact with localStorage can be found on MDC.

It boils down to using window.localStorage.setItem(key, value) and window.localStorage.getItem(key) to set and retrieve data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文