This example uses the userData behavior to preserve information in a UserData Store.HideExample<HTML>
<HEAD>
<STYLE>
.storeuserData {behavior:url(#default#userData);}
</STYLE>
<SCRIPT>
function fnSaveInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.setAttribute("sPersist",oPersist.value);
oPersist.save("oXMLBranch");
}
function fnLoadInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.load("oXMLBranch");
oPersist.value=oPersist.getAttribute("sPersist");
}
</SCRIPT>
</HEAD>
<BODY>
<FORM ID="oPersistForm">
<INPUT CLASS="storeuserData" TYPE="text" ID="oPersistInput">
<INPUT TYPE="button" VALUE="Load" onclick="fnLoadInput()">
<INPUT TYPE="button" VALUE="Save" onclick="fnSaveInput()">
</FORM>
</BODY>
</HTML>====CSDN====
无厘头冲动回帖
<HEAD>
<STYLE>
.storeuserData {behavior:url(#default#userData);}
</STYLE>
<SCRIPT>
function fnSaveInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.setAttribute("sPersist",oPersist.value);
oPersist.save("oXMLBranch");
}
function fnLoadInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.load("oXMLBranch");
oPersist.value=oPersist.getAttribute("sPersist");
}
</SCRIPT>
</HEAD>
<BODY>
<FORM ID="oPersistForm">
<INPUT CLASS="storeuserData" TYPE="text" ID="oPersistInput">
<INPUT TYPE="button" VALUE="Load" onclick="fnLoadInput()">
<INPUT TYPE="button" VALUE="Save" onclick="fnSaveInput()">
</FORM>
</BODY>
</HTML>====CSDN====
无厘头冲动回帖
解决方案 »
- mootools : Drag is not defined
- grid 显示不正常,请指教!
- 这种结构比较复杂的列表如何通过冒泡/捕获绑定事件?
- js打印PDF文件
- 倒计时程序的修改,如何开始/暂停两个按钮的功能改成一个
- 4个下拉菜单,提交时不能有相同的值
- checkbox和select关联问题,昨天帮我过我的朋友在看下
- 关于文本框只能输入数字一问?
- 求教(急).谢谢.
- 如何!!!!??????
- 在2个输入框里输入某年(如:2006)和那年里的某周(如:43)后,在另2个输入框里立刻显示这周的星期一的日期和星期日的日期?
- 一个超链接的问题.....答对立该给分(60)(jsp或javascript,javabean)不够可以再给
无厘头冲动回帖
The Cookies collection sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value and the old value is discarded.Syntax
Response.Cookies(cookie)[(key)|.attribute] = value
Parameters
cookie
The name of the cookie.
key
An optional parameter. If key is specified, cookie is a dictionary, and key is set to value.
attribute
Specifies information about the cookie itself. The attribute parameter can be one of the following. Name Description
Domain Write-only. If specified, the cookie is sent only to requests to this domain.
Expires Write-only. The date on which the cookie expires. This date must be set in order for the cookie to be stored on the client's disk after the session ends. If this attribute is not set to a date beyond the current date, the cookie will expire when the session ends.
HasKeys Read-only. Specifies whether the cookie contains keys.
Path Write-only. If specified, the cookie is sent only to requests to this path. If this attribute is not set, the application path is used.
Secure Write-only. Specifies whether the cookie is secure.
Value
Specifies the value to assign to key or attribute.
你的save是存到哪里?
oPersist.setAttribute("sPersist",oPersist.value);
//这句是赋值到input中吧oPersist.save("oXMLBranch");
//这句呢?
--------------------------------------------------------------------------------
Saves an object participating in userData persistence to a UserData store.userData.save(sStoreName)
load Method
--------------------------------------------------------------------------------
Loads an object participating in userData persistence from a UserData store.userData.load(sStoreName)
这里的用法类似ASP中的Session变量,参数sStoreName是自定义的
====CSDN====
无厘头冲动回帖