Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb how to display content of a hyperlink in a table on the same page

    hi
    i have to tables in one big outer table, they are seated in two columns. the left table is a menu. what i want to do is to make the 2nd right side table the target, so if a user clicks on a link the content is shown, just like in frameset only i dont want to use a frame set.
    Any body pls, thnx

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Iframe?

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dhtml

    That, or some DHTML to trigger the visibility of said content blocks on or off.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikkiH View Post
    Iframe?
    i have looked at the possibility of using the iframe, but how will then be possible to have the content of the iframe change with each menu selection?
    since the code for iframe is <iframe> src="file name"</iframe> that means in my understanding only one file can be dispplayed in it.
    As for the DHTML suggestion can you highlight further please.

  • #5
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    You can dynamically change the src of an iframe.

    Example only:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title> new document </title>
    <script>
    function clicker()
    {
    document.getElementById("f1").src="test3.html";
    }
    </script>
    </head>
    
    <body>
    <form>
    <input type="button" value="clickme" onclick="clicker()">
    </form>
    <iframe id="f1"  name="f1" src="test2.html"></iframe>
    </body>
    </html>

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #6
    New Coder
    Join Date
    Aug 2006
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    Just as they were saying it would work by using an iframe. For this to work, all you need to do is target the iframe, as you would do with a frameset.

    Just simple as this...


    <iframe src="blah.htm" name="myframe"></iframe>

    <a href="link1.htm" target="myframe">Link 1</a>
    <a href="link2.htm" target="myframe">Link 2</a>
    <a href="link3.htm" target="myframe">Link 3</a>

    Hope that helped!

    -SyntaxError
    Last edited by SyntaxError; 12-08-2006 at 05:18 PM.


  •  

    Posting Permissions

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