Discussions

EJB design: Stop pages from loading outside of frameset

  1. Stop pages from loading outside of frameset (2 messages)

    I have built a simple website with framesets www.muskegonawning.com. Sometimes people will find a page in a search engine results that was intended to be displayed inside frames on my website. Is there some code that I can put on each page to check that it is loaded within frames, and it isn't, can it redirect to the frameset?

    Thanks,
    Jake
  2. I don't know the answer to your question, but I DO know i does not belong in the EJB design forum...

    Regards,
    Martin
  3. Put a small javascript code under the <body> declaration :

    <body>
    <script type="text/javascript">
    <!--
    if (window.top == window.self)
     {
     window.top.location="index.jsp"
     }
    //-->
    </script>

    it will check if the url of the frame is equal with the window url and if so it will redirect users window to the correct url.

    regards
    Antony