index.php<script language=javascript>function win()
{
window.open("aa.php","","");}</script><a href=# onclick="win()" >选择栏目</a>   <a href="lmgl.php" target=main>栏目管理</a>  内容管理
这里显示 当点击‘栏目管理’或者‘内容管理’的相关内容------------------------------------------------------------------
客户端浏览index.php时:
(1)http://localhost/web/index.php 
以下是我提的问题:当点击‘栏目管理’后,URL值就变成:http://xx.xx.com/lmgl.php(但它不会影响(1)那个地址)  要把斜线后边的lmgl.php这个传给 "选择栏目" 的弹出窗口里请问这个怎么传?
注意:点击‘栏止管理’后,那个客户端游览index.php的URL地址也一直没变(因为是iframe)

解决方案 »

  1.   

    index.html<html>
    <head>
    <script language=javascript> 
    var URL = "aa.html" ;
    function win(){ 
    window.open(URL,"",""); 

    </script> 
    </head>
    <body>  
    <a href=# onclick="win()" >选择栏目 </a>&nbsp;
    <a href="lmgl.html" target="main">栏目管理 </a>
    <iframe src="" name="main" frameborder="0" scrolling="no" width="0" height="0">
    </body>
    </html>lmgl.html<html>
    <head>
    <script language=javascript> 
    var URL = window.location.pathname ;
    var n = URL.lastIndexOf("/") ;
    window.parent.URL = URL.substring(n+1) ;
    </script> 
    </head>
    <body>  
    OK!
    </body>
    </html>
      

  2.   

    index.html<html>
    <head>
    <script language=javascript> 
    var URL = "aa.html" ;
    var newWin ;
    function win(){ 
    newWin = window.open(URL,"","") ;  //newWin表示打开的子窗口,通过它可以访问子窗口的变量和方法,前提是子页面必须加载完毕。

    function test(){
    alert(newWin.URL) ;
    }
    </script> 
    </head>
    <body>  
    <a href=# onclick="win()" >选择栏目 </a>&nbsp;
    <a href=# onclick="test()" >test </a>&nbsp;
    <a href="lmgl.html" target="main">栏目管理 </a>
    <iframe src="" name="main" frameborder="0" scrolling="no" width="0" height="0">
    </body>
    </html>lmgl.html <html>
    <head>
    <script language=javascript> 
    var URL = window.location.pathname ;
    var n = URL.lastIndexOf("/") ;
    window.parent.URL = URL.substring(n+1) ; //window.parent表示frame中显示的子页面的父窗口,通过它可以访问父窗口的变量和方法。该语句就是给 父窗口定义的URL变量赋值。
    //如果是通过window.open()方法打开的子窗口,则用 window.opener表示父窗口,用法同window.parent
    </script> 
    </head>
    <body>  
    欢迎!
    </body>
    </html>