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 7 of 7
  1. #1
    bIT
    bIT is offline
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Linking page to another page in same website

    I didn't create our website so I am not familiar with how they did it. It was all hand-coded (even though I really wanted it done in Dreamweaver but I am just a worker bee)
    Okay, here is my problem. There is a story on one page (EVENTS) of the site and on another page(GIVE-MONEY) in the same website, refers to the other page. I have used the following code but its not working. Can anyone offer some suggestions? Thanks so much!

    This was the code I inserted in the EVENTS page:

    <a name="A GREAT CHANCE FOR A MATCH GIFT"></a>


    This was the code I inserted into the GIVE-MONEY page:

    <a href="http://www.midohiofoodbank.org/news-events/events/#A GREAT CHANCE FOR A MATCH GIFT">click here for more information.</a>


    When you click on the link on the GIVE-MONEY page to refer you to the EVENTS page, you just get “page not found error.”

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,826 Times in 1,810 Posts
    Hello bIT,
    Say your Give Money page is named donations.html your link would read
    Code:
    <a href="http://www.midohiofoodbank.org/news-events/events/donations.html">click here for more information.</a>
    That's assuming the path to donations.html is correct, you may need to change that.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    If I understand correctly, you're trying to make a link that will jump from one page to an anchor tag somewhere in the middle of another page.

    If so, this is code you could use to create the anchor on the EVENTS page:

    Code:
    <a id="great_chance"></a>
    I would use "id" instead of "name," and note that spaces are not allowed in the value. Modify the id however you like, just keep the rules in mind as per the link.

    On your GIVE-MONEY page, put:

    Code:
    <a href="http://www.midohiofoodbank.org/news-events/events/#great_chance">click here for more information.</a>
    matt | design | blog

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    San Francisco
    Posts
    455
    Thanks
    19
    Thanked 15 Times in 15 Posts
    I'm curious to know what you perceive the difference to be between hand-coding a site and creating it in Dreamweaver.
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx

  • #5
    Regular Coder Pepe, the bull's Avatar
    Join Date
    Feb 2005
    Location
    Vancouver, WA
    Posts
    163
    Thanks
    1
    Thanked 16 Times in 16 Posts
    Quote Originally Posted by msuffern View Post
    If I understand correctly, you're trying to make a link that will jump from one page to an anchor tag somewhere in the middle of another page.

    If so, this is code you could use to create the anchor on the EVENTS page:

    Code:
    <a id="great_chance"></a>
    I would use "id" instead of "name," and note that spaces are not allowed in the value. Modify the id however you like, just keep the rules in mind as per the link.

    On your GIVE-MONEY page, put:

    Code:
    <a href="http://www.midohiofoodbank.org/news-events/events/#great_chance">click here for more information.</a>
    Wouldn't he need the name of the file before the anchor's name? Something like...

    Code:
    <a href="http://www.midohiofoodbank.org/news-events/events/donations.html#great_chance">click here for more information.</a>
    Pepe, the bull

  • #6
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Quote Originally Posted by Pepe, the bull View Post
    Wouldn't he need the name of the file before the anchor's name? Something like...

    Code:
    <a href="http://www.midohiofoodbank.org/news-events/events/donations.html#great_chance">click here for more information.</a>
    Good catch. That he/she would.
    matt | design | blog

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    hrefs should be absolute to within your site. so,

    Code:
    <a href='http://www.example.com/directory/sub-direcotry/page.html'>link</a>
    is better written as

    Code:
    <a href='/directory/sub-directory/page.html'>link</a>
    If you move the page to within another directory, the links will still work. indeed, in the case where you may build several sites, the page can become interchangeable from one to another because it doesn't use the absolute path of http://www.....

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Tags for this Thread

    Posting Permissions

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