Tuesday, June 5, 2007

Anti-framing Javascript

<script language="JavaScript">

if (top.frames.length!=0) {

var toploc = "";

try{

toploc = top.location.host.toString();

}

catch(e){

// if you can't get the top location, it means you are being framed by another domain...
pop out

top.location=self.document.location;

}

}

</script>

No comments:

 
Jeffrey Ting Jeffrey Ting on Facebook Jeffrey Ting on Spock Jeffrey Ting on Plaxo Jeffrey Ting on Spoke Jeffrey Ting on LinkedIn