我用JavaScript利用innerText属性修改了一些网页显示的文本内容,但ASP程序提交后再回退回来时,看到文本内容又恢复成修改前的内容,请问,有什么途径可以使得按IE回退键后能保留利用innerText属性修改后的网页内容???

解决方案 »

  1.   

    用js设置的内容IE回退键后是保存不了状态的............
      

  2.   

    要保存信息请用cookies或者userdata
      

  3.   

    具体应用实例见:
    1。动态增行(存盘后可以后退回来)
    http://download.csdn.net/source/276201 
    JKHtml\SomeCodeForTable\RowAddAndDelete.htm
    2。级联下拉框
    http://download.csdn.net/source/276201
    JKHtml\SomeCodeForSelect\SelectAndSubSelect.htm
    ------------------
    主要代码:
    window.onload = historyOncemore;//Only for IE
    window.onbeforeunload = fixHistory;//Only for IE function fixHistory() //记住历史
    {
    document.getElementById("theHistoryRecord").value=document.getElementById("detailTableContainer").innerHTML;
    } function historyOncemore() //恢复历史
    {
    if (document.getElementById("theHistoryRecord").value!="")
    {
    document.getElementById("detailTableContainer").innerHTML=document.getElementById("theHistoryRecord").value;
    }
    }