简体   繁体   English

使用Javascript或类似解决方案保存会话数据

[英]Saving session data with Javascript, or similar solution

Basically what I'm trying to achieve is a basic back capability. 基本上,我想要实现的是基本的后退功能。 User goes into Girls listing, which shows him a location screen. 用户进入“女孩”列表,其中显示了一个位置屏幕。 Selects a location, and the locations are replaced by images of girls from that location using AJAX. 选择一个位置,然后使用AJAX将位置替换为该位置中的女孩图像。 User clicks on a particular girl to view her profile. 用户单击特定的女孩以查看其个人资料。 Now the user wants to go back and have a look at a different girl from that profile - he'd have to go through the location selection process yet again. 现在,用户想要返回并查看与该个人资料不同的女孩-他将不得不再次执行位置选择过程。

What I would like to achieve is to save the location screen the user was in using javascript - just simply save the whole contents of the container div, for them to be reinserted into the dom when the back button (the in page back button, not browser) is pressed. 我想实现的是保存使用javascript的用户所在的位置屏幕-只需保存容器div的全部内容,以便在使用后退按钮(页面后退按钮,而不是页面)时将它们重新插入dom浏览器)。 Now the way I was thinking of doing it is passing the string onto php, saving the string using php to flashdata, and then when back button is pressed requesting that data. 现在我想到的方式是将字符串传递到php,使用php将字符串保存到flashdata,然后在按下返回按钮请求该数据时。

Anyone got any simpler solution for what I'm trying to achieve? 有人为我要实现的目标提供了更简单的解决方案吗? You can go on www.discreetdelights.co.uk to see what im trying to achieve - a word of caution though, loads of adult content on there. 您可以访问www.discreetdelights.co.uk来查看我正在尝试实现的目标-不过请注意,那里有成人内容。

You could save this data in a cookie . 您可以将此数据保存在cookie中

Javascript cookie functions Javascript Cookie函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM