在GET请求之间保留JavaScript变量? [英] Persist javascript variables between GET requests?
问题描述
允许ASP .NET。
允许在隐藏的输入字段中存储值
不允许查询字符串
POST请求不是允许
ASP .NET is allowed
Storing the values in hidden input fields is allowed
Query String is not allowed
POST request is not allowed
可以在GET请求之间存储JS变量?
我想使用ClientScript.RegisterStartupScript在客户端上重新初始化它们
apers
我可以使用cookie吗?
$ $ $ $
有其他可能性吗?
当发出请求时存储Cookie?
It is possible to store JS variables between GET requests ?
I want to reinitialize them on the client using ClientScript.RegisterStartupScript
Can I use cookies for this ?
Are there other posibilities?
Where cookies are stored when Request is made ?
推荐答案
我使用Cookie吗?
Can I use cookies for this ?
是的,请参阅关于在Javascript中使用Cookie的教程。
是否还有其他可能性?
Are there other posibilities?
如果您不允许附加任何请求的网址,我不能提出任何。
If you are not allowed to append anything the URL of your requests, I can't come up with any.
当请求存储cookie时是什么?
Where cookies are stored when Request is made ?
<在HTTP请求标头中。上述教程将告诉你如何从Javascript中读取他们的值。在服务器端使用ASP.Net,您可以使用 Request.Cookie [cookieName]
读取cookie值,它返回 HttpCookie
。
In the HTTP request header. The aforementioned tutorial will tell you how to read their values from Javascript. On the server side with ASP.Net, you can read cookie values using Request.Cookie["cookieName"]
which returns an instance of HttpCookie
.
这篇关于在GET请求之间保留JavaScript变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!