http://community.csdn.net/Expert/topic/4811/4811906.xml?temp=.2100336

解决方案 »

  1.   

    不报错,可是没有效果,这是为什么<html xmlns="http://www.w3.org/1999/xhtml" >
    <script language="C#" runat=server>
     public string ipsession;
     private void Page_load(object sender,EventArgs e)
     {
         string yurl=string.Empty;
         if (Application["ipsession1"] == null) Response.Redirect("http://***/error.aspx");
         if (Request["url"] != null)
         {
             yurl = Request["url"].ToString();
             ipsession = Application["ipsession1"].ToString();
             ipsession =ipsession + yurl;
         }
         else
         {
             ipsession = Application["ipsession1"].ToString();     
         }
     }
    </script>
    <script type="text/jscript">
    /// 更新标题
    function main_onreadystatechange()
    {
    var main = document.getElementById( "main" );
    if( main.readyState == "complete" )
    {
    // 这里不能是以下语句
    //document.title = main.document.title;
    setTimeout( "document.title = main.document.title", 0 );
    }
    }function document_onreadystatechange()
    {
    if( document.readyState == "complete" )
    {
    // 取消该事件
    document.onreadystatechange = function(){};// 这里不能使用 inline 的方式定义
    var main = document.getElementById( "main" );
    main.onreadystatechange = main_onreadystatechange;}
    }document.onreadystatechange = document_onreadystatechange;
    </script>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
    !--
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    -->
    </style></head>
    <frameset rows="*,0" frameborder="NO" border="0" framespacing="0">
    <frame id="main" src=http://<%=ipsession%> name="mainFrame" scrolling="YES" style="overflow-y:hidden;overflow:auto;" noresize>
    <frame src="#" name="bottomFrame" scrolling="NO" noresize>
    </frameset>
    <noframes><body>
    </body></noframes>
    </html>
      

  2.   

    在document_onreadystatechange里,将下面这句添加到
    main.onreadystatechange = main_onreadystatechange;后面
    setTimeout( "document.title = main.document.title", 0 );
      

  3.   

    这样吗,还是没有效果出来!!!!
    <script language=javascript type="text/jscript">
    /// 更新标题
    function main_onreadystatechange()
    {
    var main = document.getElementById( "main" );
    if( main.readyState == "complete" )
    {
    // 这里不能是以下语句
    //document.title = main.document.title;
    setTimeout( "document.title = main.document.title", 0 );
    }
    }function document_onreadystatechange()
    {
    if( document.readyState == "complete" )
    {
    // 取消该事件
    document.onreadystatechange = function(){};// 这里不能使用 inline 的方式定义
    var main = document.getElementById( "main" );
    main.onreadystatechange = main_onreadystatechange;
    setTimeout( "document.title = main.document.title", 0 );
    }
    }document.onreadystatechange = document_onreadystatechange;
    </script>
      

  4.   

    行:1
    字符1
    错误:拒绝访问
    代码:0
    url:htp://www.infoing.com
      

  5.   

    跨域是没权限的,你的frame引用的页面必须跟主页面是同一个域名下的网站,否则不行。
      

  6.   

    不跨域直接用在子页用parent top 等可以访问的!还是谢谢你了,我再想想别的办法!
      

  7.   

    其实我的代码已经改过了,你看见的是我之前的写法,最近的写法是这样的:
    /// 更新标题
    function title_update()
    {
    try
    {
    var main = document.getElementById( "main" );
    // 这里不能是以下语句
    // document.title = main.document.title;
    setTimeout( "document.title = main.document.title", 0 );
    }catch(e){}
    }function window_onload()
    {
    // 取消该事件
    window.detachEvent("onload",window_onload);

    Apq_Init();

    var main = document.getElementById( "main" );
    main.attachEvent("onload",title_update);

    // 打开起始页面
    main.src = Apq$Config.Home;
    }window.attachEvent("onload",window_onload);==========
    我改用onload事件来处理了,原因是之前不了解onload与onreadystatechange的区别。
    现在虽然也不是非常清晰,但上面这种写法和之前那种写法相比,与我的本意更接近些。
      

  8.   

    嗯!我在现在在想在子页加iframe,url加title参数,应该可以访问框架,
    不过有个问题这个太复杂了,而且要考虑面页是否载入完成,
    有没有传参数给.js文件档的,