关注,好像需要使用cookies...........

解决方案 »

  1.   

    //在history.back()的时候文本框里的信息不会丢失
    <!-- Tell the browser the page is persistent-->
    <META NAME="save" CONTENT="history">
    <!-- Define the class for the persistent object-->
    <STYLE>
        .saveHistory {behavior:url(#default#savehistory);}
    </STYLE><!-- The default behavior is to persist form elements.
       When the saveHistory behavior is defined, form elements
       will not persist unless they have a class.
    -->
    This persists:<INPUT TYPE="text" CLASS="saveHistory">
    This does not persist:<INPUT TYPE="text"><p>
    <A HREF="http://www.meizz.com">点一下然后用浏览器返回按钮返回</A>
      

  2.   

    谢谢meizz, 这个方法对于网页后退时可以保存.我现在需要的是,我把网页发给别人,他修改好相应的值再传给我,他改的内容能否保存到网页中.
      

  3.   

    //将用户在文本框里的输入信息在用户另存页面时一起保存
    <!-- Tell the browser the page is persistent-->
    <META NAME="save" CONTENT="snapshot">
    <!-- Define the class for the persistent object-->
    <STYLE>
        .saveSnapshot {behavior:url(#default#savesnapshot);}
    </STYLE><!-- When the page is saved, the information entered in the
         persistent form element will be inserted as the value
         within the HTML file.-->
    <INPUT TYPE=text CLASS=saveSnapshot ID=oPersistInput>
      

  4.   

    谢谢meizz,保存的问题已经解决了 ^_^另外,顺便问一下,没有ID属性的文本框能不能保存?
      

  5.   

    再问一下,在这张页面上,我用javascript动态增加了一个文本框,也想保存这个文本框中的值,用这种办法是否也行得通?
      

  6.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <style>
    body
    {
    behavior:url(#default#userdata);
    }
    </style>
    </HEAD><BODY>
    先点击test,动态生成innerHTML,点击link to other uri,再点击后退,可以看到动态innerHTML依然存在。
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var a=document.body;
    function fnSave()
    {
    a.setAttribute("content", document.body.innerHTML);
    a.save("sValue");
    }
    function fnLoad()
    {
    a.load("sValue");
    if(a.getAttribute('content')!=null)
    {
    a.innerHTML=a.getAttribute('content');
    }
    }
    function fntest()
    {
    document.getElementById("el").innerHTML="blueDestiny, never-online";
    }
    window.attachEvent('onbeforeunload',fnSave);
    window.attachEvent('onload',fnLoad);
    //-->
    </SCRIPT>
    <input id="1">
    <input id="2">
    <p>
    <div id="el"></div>
    </p>
    <a href='http://blog.csdn.net/bluedestiny'>link to other uri</a>
    <button onclick="fntest()">test</button>
    </BODY>
    </HTML>
      

  7.   

    谢谢 meizz 和 BlueDestiny 的热情帮助,问题已经解决了,准备结帖了。真的是学无止尽啊!