Results 1 to 14 of 14

Thread: loading 2 pages in 1 click

  1. #1

    Thread Starter
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144

    loading 2 pages in 1 click

    Hi!

    I've got a page with 3 frames in it like this

    Code:
     _______________
    |   |           |
    |   |           |
    |   |    B      |
    |A  |           |
    |   |           |
    |   |___________|
    |___|____C______|
    In frame A I have a load of links. Some of them I want to just change frame B but others I want to change frame B & C.
    The 1st bit is easy but i can't do the 2nd bit with straight HTML (at least I can't think of a way) so I was wondering if anyone knew of a way you can do it in Javascript.

    Thanks a lot

    Mrs K
    Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!

  2. #2
    Using the <a href="whatever.html" target="a"> thing I'm pretty sure you can't, but JavaScript can do it...

  3. #3

    Thread Starter
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144
    ooohh just worked it out!!!!

    This was the code that did it!

    Code:
    <A href="file1.html" target=C onClick="parent.frames['B'].location = 'file2.html';">Click Here</A>
    so you could change as many frames as you liked!!!

    ooohh this Document Object Model isn't as stupid as it looks.
    Anyone know of a good diagram of it?

    Thanks

    Mrs K
    Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!

  4. #4
    scoutt
    Guest
    Originally posted by filburt1
    Using the <a href="whatever.html" target="a"> thing I'm pretty sure you can't, but JavaScript can do it...
    god Arien, if you don't know the answer don't reply to the post just to get you post count up. I am pretty sure she knows you can't do it that way. then you tell her that javascript can do it. well tell her the code or tell her where to look.

    Mrs. K that was it. also you can put that in to a function if you wanted. as far as a diagram, of what?

    I will find some links for the DOM for ya.

  5. #5
    scoutt
    Guest
    here is one of a table.
    http://www.webreference.com/js/column40/drawtable.html

    here is one for a doccument
    http://www.webreference.com/js/column40/drawsimple.html

    not exactly what you wanted but that is all they had

  6. #6

    Thread Starter
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144
    thanks for that! That'll be another 2 pages to build into my collection of online resources!

    I'll slowly build up a picture of it all!

    Thanks alot

    Mrs K
    Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!

  7. #7

    Thread Starter
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144
    Found a pretty good model of the DOM its here...
    http://www.paschools.pa.sk.ca/javascript/objects.htm

    it then has a lovely listing of properties and methods!!!!

    Just thought I would post this if anyone else wanted to see it!
    Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!

  8. #8
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    If you want a non-js way of doing this...


    Put frame B & C into another 'frame' page.

    So your main do would appear:
    ___________
    | | |
    | A | B |
    | | |
    | | |
    | | |
    |__|________|

    Frame B would be like:

    ___________
    | |
    | |
    | C |
    | |
    |___________|
    | D |
    |___________|


    So, from frame A, you can set your target in the links to be B if you want to change both C&D, or you can set it to C/D to change each appropriately.

    There are a million reasons NOT to do this, but I like to display my creative genius...

    Not ideal, but just another idea, and it'll work ok, I would think. Depends on your page structure, site size etc.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  9. #9
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Angry

    GODDAMN IT!!!

    I hate it when my spaces/tabs disappear....

    I hope you got the idea from the screwed up picture...

    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  10. #10
    Originally posted by rjlohan
    GODDAMN IT!!!

    I hate it when my spaces/tabs disappear....

    I hope you got the idea from the screwed up picture...

    At the risk of being flamed for making a useless post..if you enclose the picture in [code][/code] tags, it will preserve the spaces.

  11. #11
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Cheers. It prints my other spaces, why not those ones?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  12. #12
    In HTML, two or more spaces in a row get "simplified" to one space.

  13. #13
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    To fix it every other one has to be an &nbsp; (non-breaking space) or whatever ASCII code it is.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  14. #14
    Originally posted by Sastraxi
    To fix it every other one has to be an &nbsp; (non-breaking space) or whatever ASCII code it is.
    &nbsp;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width