在button中添加处理方法
<input type="button" onclick=p()>
一个可能的写法可以是:
function p(){
var o=window.open("1.html");
o.frames["iframe1"].location="2.html";}但这个问题 一直报错 frames.iframe1 为空后不是对象。大家有没有更好的方法。。

解决方案 »

  1.   

    因为o这个窗口还没加载完毕啊。你需要在1.html里面去设置打开.frames["iframe1"].location="2.html";
      

  2.   

    跳到1.html时候传个参,再在1.html里frames["iframe1"].location="2.html";
      

  3.   

    var o=window.open("1.html?url=2.html");in
    1.html<script>
    window.onload=function()
    {
     window.frames["iframe1"].location=location.split("=")[1];
    }
      

  4.   

    如果
    window.open("1.aspx?x=2.html");1.aspx里面可以直接
    <iframe src="<%=Request.QueryString["x"]%>"
      

  5.   


    我的地址本来就带参数怎么办 2.aspx?id=1
      

  6.   

    window.open("1.aspx?url=2.aspx&name=xxxxxxx");1.aspx<iframe src="<%=Request.QueryString["x"]%>?id=xxxxxxxxx&name=<%=Request.QueryString["name"]%>"></iframe>2.aspx
    Request.Params["id"]
    Request.Params["name"]
    接收
      

  7.   


    window.frames["iframe1"].location=location.split("=")[1]+"?id=2";