刷新页面后如何保存窗口的属性???? [英] How to preserver a window's property after refresh of the page ????

查看:69
本文介绍了刷新页面后如何保存窗口的属性????的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




为了保留一些设置并避免使用cookies,我想到了

以下技巧:


我只是创建一个数组作为窗口的属性:


window.aList = new Array();


和添加要在刷新后保留的值。


虽然我可以正确添加值,但一旦刷新页面,阵列就会重置,

或at至少它似乎是!


任何想法我如何保留窗口的属性????


TIA,


Tom

Hi,

In order to preserve some settings and avoid cookies I have thought of the
following trick:

I simply create an array as the property of the window:

window.aList = new Array();

and add the values to be preserved for after refresh.

While I can add the values fine, once I refresh the page the array is reset,
or at least it appears to be!

Any idea how cen I preserve the property of the the window????

TIA,

Tom

推荐答案

保留cookie中的信息是一种选择。如果您正在编写asp或jsp

页面,则可以在会话对象中保留信息。你也可以使用隐藏的表格字段将信息发回页面。


" Tom Szabo" < to*@intersoft.net.au>在消息中写道

news:41 ******** @ dnews.tpgi.com.au ...
preserve the info in cookies is one option. if you''re writing asp or jsp
pages, you could preserve the info in a session object. you could also post
the info back to the page using hidden form fields.

"Tom Szabo" <to*@intersoft.net.au> wrote in message
news:41********@dnews.tpgi.com.au...

为了保留一些设置并避免使用cookies,我想到了以下技巧:

我只是创建一个数组作为窗口的属性:

window.aList = new Array();

并添加要在刷新后保留的值。

虽然我可以正确添加值,但一旦刷新页面数组是
重置,或者至少它似乎是!

我知道如何保留窗口的属性????

TIA,

Tom
Hi,

In order to preserve some settings and avoid cookies I have thought of the
following trick:

I simply create an array as the property of the window:

window.aList = new Array();

and add the values to be preserved for after refresh.

While I can add the values fine, once I refresh the page the array is reset, or at least it appears to be!

Any idea how cen I preserve the property of the the window????

TIA,

Tom





">保留cookie中的信息是一种选择。如果您正在编写asp或jsp

"> preserve the info in cookies is one option. if you''re writing asp or jsp
页面,则可以在会话对象中保留信息。你还可以
使用隐藏的表格字段将信息发回页面。
pages, you could preserve the info in a session object. you could also post the info back to the page using hidden form fields.




谢谢南希,


但是我试图找出是否有可能将一些属性存储到窗口并在刷新后检索它们。我以为文件

会被重新播放,所以它的属性会丢失,但我认为窗口

会是相同的,所以属性会保留。 ..但是看起来我错了...... b $ b错了...


我希望我有意义,这里有点晚了......: - ))


问候,


Tom



Thanks Nancy,

But what I was trying to find out if it is possible to store some properties
to the window and retrieve them after refresh. I thought that the document
gets reloded, so it''s properties will be lost, but I thought the window
would be the same, so the properties will stay...but it appears I was
wrong...

I hope I am making sense, it is getting a little late here...:-))

Regards,

Tom




Tom Szabo < to*@intersoft.net.au>在消息中写道

news:41 ****** @ dnews.tpgi.com.au ...

"Tom Szabo" <to*@intersoft.net.au> wrote in message
news:41******@dnews.tpgi.com.au...

">保留cookie中的信息是一种选择。如果您正在编写asp或
jsp

"> preserve the info in cookies is one option. if you''re writing asp or jsp
页面,则可以在会话对象中保留信息。您还可以
pages, you could preserve the info in a session object. you could also


使用隐藏的表单字段将


post

信息发回页面。



感谢Nancy,

但是我试图找出是否有可能将一些



Thanks Nancy,

But what I was trying to find out if it is possible to store some



属性存储到窗口并在刷新后检索它们。我以为文件会被重新上传,所以它的属性会丢失,但我认为窗口
会相同,所以属性会保留......但看起来我是<错误的...


猜我猜错了你的问题。我相信你可以重新加载一个帧src,而不需要重新加载整个帧文档,所以你可以做一个隐藏的帧,坚持你的数据
,重新加载你的主框架和抓住文件从

隐藏的框架。我想我已经读过这个作为写一个购物车应用程序的原始手段,虽然我自己从来没有写过这个。


希望有所帮助

我希望我有意义,这里有点晚了...... :-))

问候,

汤姆


properties to the window and retrieve them after refresh. I thought that the document
gets reloded, so it''s properties will be lost, but I thought the window
would be the same, so the properties will stay...but it appears I was
wrong...
guess i misread your question. i believe you can reload a frame src without
reloading the entire frames document, so you could do a hidden frame, stick
your data in there, reload your main frame and grab the document back from
the hidden frame. i think i''ve read about this as a primitive means of
writing a shopping cart application, though i''ve never written this myself.

hope that helps

I hope I am making sense, it is getting a little late here...:-))

Regards,

Tom



这篇关于刷新页面后如何保存窗口的属性????的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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