<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style type="text/css">
.userData {behavior:url(#default#userdata);}
/*
url (url) : 使用绝对或相对地址指定DHTML行为组件(.htc)
url (#objID ) : 用二进制实现DHTML行为,#objID为object对象指定的id特性
url (#default#behaviorName) : IE的默认行为。由behaviorName指定
*/
</style>
<script language="javascript">
function fnGet(){
oPersistInput.load("oDataStore");//加载用户数据持久化对象从参加UserData存储。
oPersistInput.value = oPersistInput.getAttribute("sPersistAttr");
}
function fnSet(){
oPersistInput.setAttribute("sPersistAttr",oPersistInput.value);
oPersistInput.save("oDataStore");//保存用户数据的对象持久参与的UserData存储。
}
function fnRem(){
oPersistInput.removeAttribute("sPersistAttr");
oPersistInput.save("oDataStore");//保存用户数据的对象持久参与的UserData存储。
}
</script>
<body>
<input type="text" class="userData" id="oPersistInput"/>
<input type="button" value="Get Attribute" οnclick="fnGet()"/>
<input type="button" value="Set Attribute" οnclick="fnSet()"/>
<input type="button" value="Remove Attribute" οnclick="fnRem()"/>
</body>
</html>
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style type="text/css">
.userData {behavior:url(#default#userdata);}
/*
url (url) : 使用绝对或相对地址指定DHTML行为组件(.htc)
url (#objID ) : 用二进制实现DHTML行为,#objID为object对象指定的id特性
url (#default#behaviorName) : IE的默认行为。由behaviorName指定
*/
</style>
<script language="javascript">
function fnGet(){
oPersistInput.load("oDataStore");//加载用户数据持久化对象从参加UserData存储。
oPersistInput.value = oPersistInput.getAttribute("sPersistAttr");
}
function fnSet(){
oPersistInput.setAttribute("sPersistAttr",oPersistInput.value);
oPersistInput.save("oDataStore");//保存用户数据的对象持久参与的UserData存储。
}
function fnRem(){
oPersistInput.removeAttribute("sPersistAttr");
oPersistInput.save("oDataStore");//保存用户数据的对象持久参与的UserData存储。
}
</script>
<body>
<input type="text" class="userData" id="oPersistInput"/>
<input type="button" value="Get Attribute" οnclick="fnGet()"/>
<input type="button" value="Set Attribute" οnclick="fnSet()"/>
<input type="button" value="Remove Attribute" οnclick="fnRem()"/>
</body>
</html>