In my project, I am using a Classic ASP file coded in JavaScript to show HTML content. My goal is to detect whether the page is being displayed within a frame or not, and if it's not, redirect it to another page. Is there a way to achieve this in Classic ASP? I attempted to use "window", but it did not work as expected. The code structure I have in mind is something similar to this:
<%@ language = "JavaScript"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Secure Area</title>
<link href="css/basic.css" rel="stylesheet" type="text/css" media="all" />
<%
if (!window.parent)
window.location.replace("index.html");
%>
<link href="Images/FavIcon.ico" rel="shortcut icon" type="image/x-icon" />
</head>
</html>