下面是原贴内容:
B页面有一个函数
      function AddChartValue(Value, Name, Repress)
        {
             ..............
        }我想在A页面中用JAVASCRIPT函数实现: 1 在新窗口中打开B页面
                   2 调用  AddChartValue 函数并传递参数请高手指点一下

解决方案 »

  1.   

    要不你这样改一下试试?function AddChartValue()
    {
    window.self.status = "This message will display in the window status bar."
    }
      

  2.   

    为什么不用open打开,然用opner就可以存取打开此窗口的一切元素。
      

  3.   

    这个可以实现,不过你得把页面的显示延时考虑进去,2个页面中js的初始化速度是不一致的,你得考虑这种情况下的异步问题。给你一段代码,你参考一下。<!-- a.html --><html>
    <title>A</title>
    <body>
    <Script language="javascript">
    var win = window.open("b.html");
    var excall = function(){}
    if (win){
      excall = function(){
        win.AddChartValue();
      }
    }
    else{
      alert("窗口被屏蔽!");
    }
    </Script>
    </body>
    </html><!-- b.html --><html>
    <title>b</title>
    <body>
    <Script language="javascript">
    function AddChartValue(){
      status = "This message will display in the window status bar.";
    }
    window.onload = function(){
      if (self.opener){
        self.opener.excall();
      }
    }
    </Script>
    </body>
    </html>
      

  4.   

    把<script></script>变成
    <script defer></script>
    让js再页面完全载入的情况下再用js
      

  5.   

    谢谢各位,问题解决了,就是fandiy(继文)说的那样.