38 users online (0 members and 38 guests)  


  Results 1 to 6 of 6

Related

  1. Linking iframes in different page?    Forum: HTML Forum
    Replies: 1
  2. Linking within a page    Forum: HTML Forum
    Replies: 8
  3. Replies: 1
  4. page linking problem i believe    Forum: HTML Forum
    Replies: 14
  1. #1
    vasile's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2008
    Location
    Outer Banks
    Posts
    7

    Unhappy problem with linking a page

    I am currently working on my first website, but I am stucked with a problem.
    I am trying make a page open in a box (in a div) of my home page. Somehow, no matter what I do, my page will either not open at all, or open in a separate window. I am useing the "target" javascript command (the one that i found on the net.
    Is that the right way to do it? Am I on the right path?
    Or is it at least possible to open that window in a div?

  2. #2
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: problem with linking a page

    You cannot do it using target attribute since it's use is for iframe.

    You can either, use iframe for this one or use either these two:
    innerHTML
    firstChild.nodeValue

    See if it helps.

  3. #3
    firmaterra's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    81

    Re: problem with linking a page

    How about posting your code for us????

  4. #4
    vasile's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2008
    Location
    Outer Banks
    Posts
    7

    Re: problem with linking a page

    This is what I'm stucked on right now:
    <head>
    <script>function photoopen()
    {
    document.getElementById('photos').innerHtml="2005.html";
    }
    </script>
    </head>

    <body>

    <div id="side-bar">
    <ul>
    <li><a href="albums/2005.html" onClick="photoopen()";> 2005's album</a></li>
    <li><a href="#" >2006's album</a></li>
    <li><a href="#" >2007's album</a></li>
    <li><a href="#" >2008's album</a></li>
    </ul>
    </div>

    <div id="photos">
    </div>
    </body>
    So, what I am trying to do, is to have another page (2005.html) open inside the #photos
    And similar for the other links in the side-bar, they will call hteir own page.
    I have tried useing the innerHtml as an attribute of the link, but that didn't work eitgher.
    Is the mechanism used wrong, or is just a problem of syntax?

  5. #5
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: problem with linking a page

    JS is case-sensitive. Capitalization do matters.

    The correct syntax is innerHTML.

    Anyway, what you wanted to achieve is impossible to do with innerHTML. Your simple way of achieving this is through iframe.

    You could also use ajax to do this stuff for you, but i'm out of my wits on it.

    Hope it helps.

  6. #6
    vasile's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2008
    Location
    Outer Banks
    Posts
    7

    Thumbs up Re: problem with linking a page

    iframes certainly helped.
    Problem solved - thank you guys.



Tags for this Thread