<script type ="text/javascript">
   function Goto()
   {
      var a=escape ('你是猪').toString();
     window.open ('Default2.aspx?id=001');
      //document.write (escape("中文"));
      
   }
 
    </script>
请问window.open时候带的参数怎么编码让别人看不是id=001,目标页面又是怎么解码呢?谢谢。 c#.net程序
请给出小列子多谢

解决方案 »

  1.   

    可以通过设置一个隐藏的数据域  子窗口有一个父窗口的引用 parent 应该可以得到这个数据域吧
      

  2.   

    用模态对话框就可以 <html>
    <head>
        <title>无标题页</title>
        <script language="javascript" type="text/javascript">
              function opendialog1()
         {
             var someValue=window.showModalDialog("b.html","","dialogWidth=500px;dialogHeight=500px;status=no;help=no;scrollbars=no");
             document.form1.p1t.value=someValue;
         }    </script>
    </head>
    <body>
        <form name="form1" action="#">
            <input type="text" name="p1t">
            <input type="button" value="打开对话框" onclick="opendialog1()">
        </form>
    </body>
    </html>子窗口:<html>
    <head>
        <title>无标题页</title>
        <script language="javascript" type="text/javascript">
        function a()
        {
            var wname = document.form1.backname.value;
            parent.window.returnValue=wname; //父窗口就是上一个页面
           window.close();
        }
    </script>
    </head>
    <body>
        <form name="form1" action=""> 
            <input type="text" value="输入要传的值" name="backname">
            <input type="button" value="传值" onclick="return a()">
        </form>
    </body>
    </html
      
      

  3.   

    encodeURIComponent
    decodeURIComponent
      

  4.   

     <script type ="text/javascript">
       function Goto()
       {
          var a=escape ('你是猪').toString();
         window.open ('Default2.aspx?id=001');
          //document.write (escape("中文"));
          
       }
     
        </script>
    我的意思是 window.open ('Default2.aspx?id=001')不是要跳转到了Default2.aspx页面嘛
    这是IE的地址栏里显示的 http://Default2.aspx?id=001对吧!
    1.那么怎么让别人看不见=001呢?怎么用一些别的字符代替?
    2.同时Default2.aspx.cs页面怎么获得传过来的id的值?(=001已经被加密显示的类似乱七八糟的符号)
    就是get方式页面间传递参数的,参数值加密解密的方法