window.frames[0].window.location.href试试

解决方案 »

  1.   

    document.getElementsByTagName('iframe')[0].contentWindow.location.href
      

  2.   

    <iframe id="ids" src="http://www.baidu.com"></iframe>var srcs = document.getElementById('ids').src;
    alert(srcs);
      

  3.   


    正解,先设置id ,然后用jquery获取
      

  4.   

    在labels.html后加上特定时间,比如lables.html?20081116。在实际工作中,在我更新css/javascript文件后,我都是用这种办法来防止文件被缓存。
      

  5.   

    同求答案,
    var srcs = document.getElementById('ids').src;
     alert(srcs);
    我试了也不行啊
      

  6.   

    var srcs = document.getElementById('ids').src;
     alert(srcs);
    肯定是可以的,而window.frames[0].window.location.href在跨域的时候则不行,在同一个域下也是可以的。
    我写了个例子:http://jsfiddle.net/DpQVg/
      

  7.   

    楼主是说要动态的嘛,楼上获得的都是原始SRC,搞犊子嘛
      

  8.   

    我和楼主一样的问题,已经解决了
    iframe的当前url的获取方法
    代码如下:
    parent.document.getElementById("content_info").contentWindow.location.href
    其中:content_info为iframe的id