我的域名为: www.abc.com
 有一个人网站想要使用iframe嵌套我的网站到他的系统里面,我想要一个设置,如何检测出是哪一家网站嵌套的我的网站   我可以page_load中首先检测嵌套我的网站域名,然后再检查这个域名是否合法, 不合法我就跳转至一个错误页面。     如何才能得到嵌套我网站的域名呢。。

解决方案 »

  1.   

    很多,比如 document.URL
    location.href
      

  2.   

    http://www.cnblogs.com/wenghaowen/archive/2012/09/21/2696819.html
      

  3.   

    例如下面是别人的网站<table class="style1">
                <tr>
                    <td class="style2">
                        <a href="http://localhost:52638/index.aspx?key=F709AE" target="frmright">测试1</a></td>
                    <td rowspan="4">
                        <iframe style="z-index: 1; width: 100%; height: 500px; visibility: inherit" id="frmright"
                            src="" frameborder="0" name="frmright" scrolling="yes"></iframe></td>
                </tr></table>
    在iframe中打开的是我自己的网站, 我如何在我的网站中获取到他的网页详细地址呢
      

  4.   

    在Iframe里面执行window.top.location.href