document.loginform.username.load("data");
document.loginform.username.save("data");username是input type='text' 类型的,这个属性或对象没有load,save方法啊,难道可以给属性添加方法?
这是怎么回事
document.loginform.username.save("data");username是input type='text' 类型的,这个属性或对象没有load,save方法啊,难道可以给属性添加方法?
这是怎么回事
解决方案 »
- 没明白,所以来问你们了
- 使用memcached+tomcat6配置集群时出错
- 我想知道jsp数据储存原理,那位大神能指教??
- 求高手指点ajax获得数据显示
- 求解SQL语句
- \r\n 如何转换成 UTF-8 格式的,在jsp页面中正常显示换行
- JSP的一个简单转义字符的问题
- struts中文乱码问题
- 请教各高手一个JSP问题??
- JSP中禁用cookie和session的问题
- 编译时提示:软件包org.apache.commons.fileupload.*不存在?
- The server encountered an internal error () that prevented it from fulfilling th
<%@ page contentType="text/html; charset=GBK"%>
<html>
<head>
<title>网上服务系统!</title>
<style type="text/css">
.login_input01 {
behavior:url(#default#userdata);
font-family: "宋体";
font-size: 13px;
color: #000000;
border:1px solid #888;
height: 20px;
}
</style>
</head><body style="background:url(images/indexbg.jpg) no-repeat center center #d6d6d6;" onkeydown="if(event.keyCode==13) document.all('logonb').click()">
<form name="loginform" method="POST" action="<%=request.getContextPath()%>/login/nds/logon.jsp" onSubmit="return checkPassword();">
<table style="position:absolute;top:68%;left:16%;font-size:14px">
<tr><td>用户名:<input name="username" class="login_input01" onkeydown='if(event.keyCode==13) event.keyCode=9' size="22">
<td rowspan=2> <img src="images/login.jpg" id=logonb onClick="saveChecked();document.forms[0].submit()" style="cursor:hand">
<tr><td>密 码:<input name="password" class="login_input01" onkeydown='if(event.keyCode==13) event.keyCode=9' type="password" size="22"/>
<tr><td colspan=2 style="text-align:center">记住用户名和密码<input type="checkbox" name="aLogin" id="aLogin" class="input" value="0" title="记住用户名和密码">
</table>
</form><script language="JavaScript">
String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g,"")}
function userLoad(){
document.loginform.username.load("oDataStoreU");
document.loginform.aLogin.value=document.loginform.username.getAttribute("aLogin");
if(document.loginform.aLogin.value=="1"){
document.loginform.aLogin.checked=true;
document.loginform.username.value=document.loginform.username.getAttribute("username");
document.loginform.password.value=document.loginform.username.getAttribute("password");
}else
document.loginform.aLogin.checked=false;
}function userSave(){
document.loginform.username.value=document.loginform.username.value.trim();
document.loginform.password.value=document.loginform.password.value.trim();
document.loginform.username.setAttribute("username",document.loginform.username.value.trim());
document.loginform.username.setAttribute("password",document.loginform.password.value.trim());
if(document.all["aLogin"].checked==true)
document.loginform.username.setAttribute("aLogin","1");
else
document.loginform.username.setAttribute("aLogin","0");
document.loginform.username.save("oDataStoreU");
}function saveChecked(){
if(document.all["aLogin"].checked==true){
if(document.all["username"].value.trim()!="" && document.all["password"].value.trim()!="");
userSave();
}else{
document.loginform.username.value=document.loginform.username.value.trim();
document.loginform.username.setAttribute("aLogin","0");
document.loginform.username.save("oDataStoreU");
}
}
function checkPassword(){
if(document.all.password.value==""){
alert("请输入密码!");
document.all.password.focus();
return false;
}
return true;
}
function window.onload(){
userLoad();
}
</script>
</body>
</html>
没有看到save和load法方啊?
咋回事?
你的问题应该是将<input>标签增加了load和save方法
ParameterssStoreName Required. String that specifies the arbitrary name assigned to a persistent object within a UserData store. Return ValueNo return value.ResThe load method reads information from a UserData store. You can determine access to a UserData store by specifying a path within the immediate directory tree between the Web root and the current folder. For example, if you save the UserData store in the /private/ folder, a Web page located in the /public/ folder cannot access that UserData store.This method requires an object participating in userData persistence, where the object has an ID and a class name equal to the persistence behavior. ExampleThis example uses the load method to read information about an object participating in userData persistence saved in a UserData store