HTML page loads external frame

Discussion in 'HTML' started by Silver, Jun 20, 2006.

  1. Silver

    Silver Guest

    I have a main page that includes one menu and one iFrame.
    Depending on the selections made on a menu, a different html page is
    loaded inside the iFrame. The menu is just a list of <a href=...>

    i.e. The user presses the "first" key on the menu, then the first page
    is loaded inside the frame.

    Find here a sample for the pages I use.

    index.html
    ==========================================
    <html>
    <body>
    <!-- menu here -->
    <iframe src="first.htm"></iframe>
    </body>
    </html>
    ==========================================

    first.html
    ==========================================
    <p>
    Hello world
    </p>
    ==========================================

    Here is my question. I want that when someone types in the browser
    addressbar the address www.mysite.com/first.html, then instead of
    loading just the "first.htm" l file, I want to see the entire
    "index.html" page and the "first.html" file loaded inside the iFrame.
    Is it possible? How can I do in order to do it?
    Thank you much in advance.

    Mario Jannelli
    www.silverino.com
     
    Silver, Jun 20, 2006
    #1
    1. Advertising

  2. Silver wrote:

    > Here is my question. I want that when someone types in the browser
    > addressbar the address www.mysite.com/first.html, then instead of
    > loading just the "first.htm" l file, I want to see the entire
    > "index.html" page and the "first.html" file loaded inside the iFrame.
    > Is it possible?


    No

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Jun 20, 2006
    #2
    1. Advertising

  3. Silver

    Evertjan. Guest

    David Dorward wrote on 20 jun 2006 in comp.lang.javascript:

    > Silver wrote:
    >
    >> Here is my question. I want that when someone types in the browser
    >> addressbar the address www.mysite.com/first.html, then instead of
    >> loading just the "first.htm" l file, I want to see the entire
    >> "index.html" page and the "first.html" file loaded inside the iFrame.
    >> Is it possible?

    >
    > No
    >


    Yes [if the diference between .htm and .html is a typo]


    ============= in first.html =============

    <script type='text/javascript'>
    if (self == top) location.href='index.html?f=first.html'
    </script>

    ============= in index.html =============

    select the f=filename by location.hash and load the iframe.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 20, 2006
    #3
  4. Evertjan. wrote:
    > David Dorward wrote on 20 jun 2006 in comp.lang.javascript:
    >
    >> Silver wrote:
    >>
    >>> Here is my question. I want that when someone types in the browser
    >>> addressbar the address www.mysite.com/first.html, then instead of
    >>> loading just the "first.htm" l file, I want to see the entire
    >>> "index.html" page and the "first.html" file loaded inside the iFrame.
    >>> Is it possible?

    >> No
    >>

    >
    > Yes [if the diference between .htm and .html is a typo]
    >
    >
    > ============= in first.html =============
    >
    > <script type='text/javascript'>
    > if (self == top) location.href='index.html?f=first.html'
    > </script>
    >
    > ============= in index.html =============
    >
    > select the f=filename by location.hash and load the iframe.
    >


    Better to do it with server-side and not depend on JavaScript

    index.php?f=first.html

    It is one of the nasty bit with frames, (iframes included) and I guess
    to prevent breaking out of frames a non-javascript solution would be a
    rewrite in the .htacess file.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 20, 2006
    #4
  5. Evertjan. wrote:

    >> No


    > Yes [if the diference between .htm and .html is a typo]


    Oh, misunderstood the question. It isn't trying to capture *any* page the
    user tries to visit in the frame.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Jun 20, 2006
    #5
  6. Silver

    Evertjan. Guest

    Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:

    >> ============= in first.html =============
    >>
    >> <script type='text/javascript'>
    >> if (self == top) location.href='index.html?f=first.html'
    >> </script>
    >>
    >> ============= in index.html =============
    >>
    >> select the f=filename by location.hash and load the iframe.
    >>

    >
    > Better to do it with server-side and not depend on JavaScript


    Sure, but it can be done clientside.


    > index.php?f=first.html
    >
    > It is one of the nasty bit with frames,


    There are no frames to break out if (self == top), not?

    > (iframes included) and I guess
    > to prevent breaking out of frames a non-javascript solution would be a
    > rewrite in the .htacess file.



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 20, 2006
    #6
  7. Silver

    Evertjan. Guest

    David Dorward wrote on 20 jun 2006 in comp.lang.javascript:

    > Evertjan. wrote:
    >
    >>> No

    >
    >> Yes [if the diference between .htm and .html is a typo]

    >
    > Oh, misunderstood the question. It isn't trying to capture *any* page the
    > user tries to visit in the frame.


    No harm done, that what's a NG is all about.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 20, 2006
    #7
  8. Silver

    jojo Guest

    Silver wrote:
    >>
    >> Here is my question. I want that when someone types in the browser
    >> addressbar the address www.mysite.com/first.html, then instead of
    >> loading just the "first.htm" l file, I want to see the entire
    >> "index.html" page and the "first.html" file loaded inside the iFrame.
    >> Is it possible?


    Evertjan. wrote:
    [Yes]

    > ============= in first.html =============
    >
    > <script type='text/javascript'>
    > if (self == top) location.href='index.html?f=first.html'
    > </script>
    >
    > ============= in index.html =============
    >
    > select the f=filename by location.hash and load the iframe.
    >


    For what reason do you need the hash? Its also possible to use SSI (if
    available on the Server) and write into "index.html"

    <iframe href="<!--#echo var="http_referer"-->"></iframe> (Don't worry
    about the tag-looking construction in another Tag, this is just a
    SSI-command which is replaced from the server before any browser has to
    validate it)
     
    jojo, Jun 20, 2006
    #8
  9. Evertjan. wrote:
    > Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:


    >> Better to do it with server-side and not depend on JavaScript

    >
    > Sure, but it can be done clientside.


    I didn't say it couldn't, just that it is better done server-side.

    >
    >> index.php?f=first.html
    >>
    >> It is one of the nasty bit with frames,

    >
    > There are no frames to break out if (self == top), not?


    Won't work if I have JavaScript disabled....



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 20, 2006
    #9
  10. Silver

    Evertjan. Guest

    Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:

    > Evertjan. wrote:
    >> Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:

    >
    >>> Better to do it with server-side and not depend on JavaScript

    >>
    >> Sure, but it can be done clientside.

    >
    > I didn't say it couldn't, just that it is better done server-side.


    You are repeating yourself.

    >>> index.php?f=first.html
    >>>
    >>> It is one of the nasty bit with frames,

    >>
    >> There are no frames to break out if (self == top), not?

    >
    > Won't work if I have JavaScript disabled....


    That can be said for all clientside code on this NG
    and has nothing to do with the surmized nastiness of frames above.

    So what is your point?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 20, 2006
    #10
  11. Silver

    Evertjan. Guest

    jojo wrote on 20 jun 2006 in comp.lang.javascript:

    > Silver wrote:
    >>>
    >>> Here is my question. I want that when someone types in the browser
    >>> addressbar the address www.mysite.com/first.html, then instead of
    >>> loading just the "first.htm" l file, I want to see the entire
    >>> "index.html" page and the "first.html" file loaded inside the iFrame.
    >>> Is it possible?

    >
    > Evertjan. wrote:
    > [Yes]
    >
    >> ============= in first.html =============
    >>
    >> <script type='text/javascript'>
    >> if (self == top) location.href='index.html?f=first.html'
    >> </script>
    >>
    >> ============= in index.html =============
    >>
    >> select the f=filename by location.hash and load the iframe.
    >>

    >
    > For what reason do you need the hash? Its also possible to use SSI (if
    > available on the Server) and write into "index.html"


    Because this NG is about javascript, and perhaps especially clientsided.

    It can also be done by serverside javascript.


    > <iframe href="<!--#echo var="http_referer"-->"></iframe> (Don't worry
    > about the tag-looking construction in another Tag, this is just a
    > SSI-command which is replaced from the server before any browser has to
    > validate it)
    >




    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 20, 2006
    #11
  12. Silver

    jojo Guest

    Evertjan. schrieb:
    > jojo wrote on 20 jun 2006 in comp.lang.javascript:
    >
    >> Silver wrote:
    >>>> Here is my question. I want that when someone types in the browser
    >>>> addressbar the address www.mysite.com/first.html, then instead of
    >>>> loading just the "first.htm" l file, I want to see the entire
    >>>> "index.html" page and the "first.html" file loaded inside the iFrame.
    >>>> Is it possible?

    >> Evertjan. wrote:
    >> [Yes]
    >>
    >>> ============= in first.html =============
    >>>
    >>> <script type='text/javascript'>
    >>> if (self == top) location.href='index.html?f=first.html'
    >>> </script>
    >>>
    >>> ============= in index.html =============
    >>>
    >>> select the f=filename by location.hash and load the iframe.
    >>>

    >> For what reason do you need the hash? Its also possible to use SSI (if
    >> available on the Server) and write into "index.html"

    >
    > Because this NG is about javascript, and perhaps especially clientsided.


    I'm sorry, I missed that this question is crossposted... I read it at
    alt.html which does not only deal with JavaScript...

    >
    > It can also be done by serverside javascript.
    >
    >
    >> <iframe href="<!--#echo var="http_referer"-->"></iframe> (Don't worry
    >> about the tag-looking construction in another Tag, this is just a
    >> SSI-command which is replaced from the server before any browser has to
    >> validate it)
    >>

    >
    >
    >
     
    jojo, Jun 20, 2006
    #12
  13. Silver

    Evertjan. Guest

    jojo wrote on 20 jun 2006 in comp.lang.javascript:

    >> Because this NG is about javascript, and perhaps especially clientsided.

    >
    > I'm sorry, I missed that this question is crossposted... I read it at
    > alt.html which does not only deal with JavaScript...
    >


    Same here but inverted.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 20, 2006
    #13
  14. Evertjan. wrote:
    > Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
    >
    >> Evertjan. wrote:
    >>> Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
    >>>> Better to do it with server-side and not depend on JavaScript
    >>> Sure, but it can be done clientside.

    >> I didn't say it couldn't, just that it is better done server-side.

    >
    > You are repeating yourself.


    Yes I am, your remarks seemed to challenge my assertions that
    client-side option is vulnerable to client browser settings where are
    server-side is not. Or is your problem a perspective problem, not
    realizing this is a cross-posted thread.

    >
    >>>> index.php?f=first.html
    >>>>
    >>>> It is one of the nasty bit with frames,
    >>> There are no frames to break out if (self == top), not?

    >> Won't work if I have JavaScript disabled....

    >
    > That can be said for all clientside code on this NG
    > and has nothing to do with the surmized nastiness of frames above.
    >
    > So what is your point?
    >


    If you look he has cross-posted to alt.html where I am posting from. The
    scope is a little more generalized.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 20, 2006
    #14
  15. Silver

    Evertjan. Guest

    Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:

    >> So what is your point?
    >>

    >
    > If you look he has cross-posted to alt.html where I am posting from. The
    > scope is a little more generalized.
    >


    Roger, oversaw the short named NG.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jun 21, 2006
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    408
    Neredbojias
    May 8, 2006
  2. =?Utf-8?B?TmVhbA==?=
    Replies:
    0
    Views:
    385
    =?Utf-8?B?TmVhbA==?=
    Jul 17, 2006
  3. Philip no spam thx

    how to ensure page loads in frame?

    Philip no spam thx, Jul 3, 2003, in forum: Javascript
    Replies:
    0
    Views:
    98
    Philip no spam thx
    Jul 3, 2003
  4. Replies:
    0
    Views:
    86
  5. Silver

    HTML page loads external frame

    Silver, Jun 20, 2006, in forum: Javascript
    Replies:
    14
    Views:
    191
    Evertjan.
    Jun 21, 2006
Loading...

Share This Page