http://community.csdn.net/Expert/topic/4552/4552560.xml?temp=.9258386

解决方案 »

  1.   

    这是在b.php
    window.opener.document.getElementById("文本框p).value 相当于 a.html里的东西
     document.getElementById("文本框s).value;  相当于 b.php里的东西
      

  2.   

    小弟用的是asp.net,仅作参考
    ------------------------------------------
     function getvalue()
      {
        
        var text1value = document.Form1.text1.value ;
        var text2value = document.Form1.text2.value ;    
        var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
              
              var url="text3.aspx?action=reg&text1="+document.Form1.text1.value+"&text2="+document.Form1.text2.value;
      xmlhttp.open("post", url, false); 
       xmlhttp.send();      
              if (xmlhttp.readyState == 4) // 调用完毕
                     {
                       if(xmlhttp.status==200)
                        {
                           
                           alert(xmlhttp.responseText);
                        }   
                        else
                        {
                          
                          alert('err');
                        }
                     }
      }
    ------------------------------------------------------------------------
    test3的html页面
    <%@ Page language="c#" Codebehind="text3.aspx.cs" AutoEventWireup="false" Inherits="riqi.text3" %>
    --------------------------
    test3的cs页面
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace riqi
    {
    /// <summary>
    /// text3 的摘要说明。
    /// </summary>
    public class text3 : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    int  a = Convert.ToInt32(Request.QueryString["text1"] ); 
    int  b = Convert.ToInt32(Request.QueryString["text2"] );
    int c = a+b;
    Response.Write(c); 
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion
    }
    }
    ----------------------------------------------
    我想原理应该是一样的
      

  3.   

    quhaihua(七太保) 我不能用xmlhttp呀
      

  4.   

    这是在b.php
    window.opener.document.getElementById("文本框p).value 相当于 a.html里的东西
     document.getElementById("文本框s).value;  相当于 b.php里的东西着个办法可以但是我想a.html得到值后还要计算然后再输出,这个办法好象不行了
      

  5.   

    我设想
    b.php
    echo "<script>window.location.href='a.html?c=3'</script>"
    在a.html中有办法能得到c吗