也可以用URL传递
用location.search读取

解决方案 »

  1.   

    你们说明白点嘛
    比如 第一个页面中有个
    var key
    function textcontent(x)
    {
    key=document.getElementById(x).value
    return key
    //document.getElementById(x).value=y.toUpperCase()
    }这个key值怎么样在其他 html页面使用呢
      

  2.   

    //楼上说的对用cookies:
    function textcontent(x)
    {
    key=document.getElementById(x).value;
    document.cookie="key="+key;
    return key;
    //document.getElementById(x).value=y.toUpperCase()
    }
    //其他 html页面读取:
    <%=request.cookies("key")%>
      

  3.   

    <!--第一个页面-->
    <html><head>
    <script>
    var key;
    function textcontent(x)
    {
    key=document.getElementById(x).value;
    location.href="test.htm?"+key;
    }
    </script>
    </head><body>
    <input id=x value=""/>
    <input type=button value="跳转到test.htm页面" onclick="javascript:textcontent('x');">
    </body></html><!--第二个页面-->
    <html>
    <head>
    <title>text.htm页面</title>
    <script defer>
    var url=window.document.location.search;
    if(url!=null)
    {
    url=url.substring(1,url.length);
    }
    alert(url);
    </script>
    </head>
    <body></body>
    </html>