在第一个iframe中用如下js:
addr = parent.getElementById('idOfIframe3').src;

解决方案 »

  1.   

    我想这样<a href="http://www.xx.com/q?a="这里我想插入我问题所获取的网址 target="main">
    好像框架内是163.com,然后链接就直接访问http://www.xx.com/q?a=http://www.163.com/上面文章'这里我想插入我问题所获取的网址'这一段应该怎样写?框架内的网页不是固定的src,会随着按另一个框架链接而改变求解,有答案就结账啦
      

  2.   

    苦等....请问用js怎样获取之前一个页面的URL?准备结贴..急或者用PHP也可以
      

  3.   


    <a href="http://www.xx.com/q?a=http://www.163.com" target="main">http://www.xx.com/q?a=http://www.163.com </a><br>
    <a href="http://www.xx.com/q?a=http://www.sina.com.cn" target="main">http://www.xx.com/q?a=http://www.sina.com.cn </a><br>
    <a href="http://www.xx.com/q?a=http://www.baidu.com" target="main">http://www.xx.com/q?a=http://www.baidu.com </a>
    <script>
    var links=document.all.tags("a")
    var total=links.length
    alert("一共有"+total+"个连接")
    for (i=0;i<total;i++){
    alert("第"+(i+1)+"个连接到\n"+links[i].href.replace("http://www.xx.com/q?a=", ""))
    }
    </script>