防止被框架

<SCRIPT LANGUAGE="JavaScript">
<!--

if (top.location !== self.location)
{
    alert('请不要在Frame中包含www.prcer.com!');
    window.open('http://www.prcer.com','_top');
}

function SetCookie(sName, sValue, timeKeepM)
{
    var now=new Date();
    var expireTime= new Date(now.valueOf()+timeKeepM*60000);
    document.cookie = sName + "=" + escape(sValue) + "; path=/; expires=" + expireTime.toGMTString() + ";";
}

function GetCookie(sName)
{
    var aCookie = document.cookie.split("; ");
    for (var i=0; i < aCookie.length; i++)
    {
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0])
            return unescape(aCrumb[1]);
    }
    return null;
}


//-->
</SCRIPT>

Tags: 框架

« 上一篇 | 下一篇 »

相关文章

发表评论

评论内容 (必填):