don't click here

Crap with HTML

Discussion in 'Technical Discussion' started by saxman, Dec 6, 2008.

  1. saxman

    saxman

    Oldbie Tech Member
    I suck at this. I have two files -- messier.htm and m01.htm. Step 13 is as follows:

    The iframe it's refering to from the messier file is as follows:

    Code (Text):
    1. <iframe src="m01.htm" width="460px" height="240px" marginwidth="0px" marginheight="0px">
    2. You need inline frames to view the slide show. Go [URL=m01.htm]here[/URL].
    3. </iframe>
    I don't know HOW I'm supposed to do this. I've searched the internet and my text book, and I can't find anything. I know how to embed an HTML file, but from my understanding it's asking me to do some sort of reverse-embed. I'm stuck! Please help!
     
  2. Hi, what are you actually trying to do? I think that seems a bit unclear... seriously, you said you're able to embed it. If you hadn't said that, I would have told you how to.. but... :P
     
  3. FraGag

    FraGag

    Tech Member
    The only method that comes to my mind is adding a bit of javascript. I don't recall any pure HTML way of doing this (using a META redirect would redirect whether or not the page is embedded in a frame). Anyway, he's how I would code it (in the HEAD of m01.htm):
    Code (Text):
    1. <script type="text/javascript">
    2. if (window === window.top) {
    3.     location.href = "messier.htm";
    4. }
    5. </script>
    This code checks if the page is in a frame or not; if it isn't, it will redirect to messier.htm; if it is, window.top will refer to the window containing messier.htm, so the redirection won't occur. However, this behavior contradicts the alternate content you have put in the iframe in your example above.