请教网页格式在客户端保存,刷新后不会改变格式
小弟在网上搜到一段代码。是关于利用userData实现客户端保存表单数据。
以下代码是能够保存文本框的数据,我想改成保存整个首页的内容,应该如何实现,小弟恳求大侠前来帮忙
<HTML>
<HEAD>
<STYLE>
.userData {behavior:url(#default#userdata);}
</STYLE>
<SCRIPT>
function fnSaveInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.setAttribute( "sPersist ",oPersist.value); //将oPersist.value存储为sPersist属性
oPersist.save( "oXMLBranch "); //存储在名为oXMLBranch的UserData存储区
}
function fnLoadInput(){
var oPersist=oPersistForm.oPersistInput;
oPersist.load( "oXMLBranch "); //载入在名为oXMLBranch的UserData存储区
oPersist.value=oPersist.getAttribute( "sPersist "); //将sPersist属性赋值给oPersist.value
}
</SCRIPT>
</HEAD>
<BODY>
<FORM ID= "oPersistForm ">
<INPUT CLASS= "userData " TYPE= "text " ID= "oPersistInput ">
<INPUT TYPE= "button " VALUE= "Load " onclick= "fnLoadInput() ">
<INPUT TYPE= "button " VALUE= "Save " onclick= "fnSaveInput() ">
</FORM>
</BODY>
</HTML>
------解决方案--------------------//给table们加上事件
function ini