A way to implement a frame by using JavaScript to access any page on this site

Source: Internet
Author: User
Tags implement window access
javascript| Access | load | page | site

Default.asp

       <TITLE> my home page </ Title>
     <meta content= "text/html; charset=gb2312" HTTP-EQUIV=CONTENT-TYPE>
     <meta content= "MSHTML 5.00.3315.2870" NAME=GENERATOR>
    <%
' to determine the display page of the right frame
   Dim addr
   addr=request ("url")
   if Url= "" Then
    url= "left.htm"
   End If
 %>
  <frameset rows= 81,*>
     <frame name=top scrolling=no src= "top.htm"
     <frameset cols=238,* noresize>
       <frame name=left scrolling=no <%=url%>>
       <frame name=main src= "index.htm"
      </frameset>
  </frameset>

Index.htm

<script>
try{
if (parent.frames (' top '))
Alert ("presence mainframe");
}
catch (E)
{window.open ("http://10.69.17.119/OpenFrame/default.asp?url= '" + document.location + "" "," _self ");
}
</script>
<body >
This is the </body>

Chk.js

function LoadFrame ()
{
try{
if (parent.frames (' top ') && parent.frames (' left ') && parent.frames (' Main '))
Alert ("The page is already open in frame");
}
catch (E)
{window.open ("http://10.69.17.119/OpenFrame/default.asp?url= '" + document.location + "" "," _self ");
}
}

Left.htm

<body >
This is the </body>

Top.htm

<body ">
This is the </body>

In this case, only the index.htm are limited, if there are more than one page needs to be processed!
Relatively simple without too many comments, hope to understand!



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.