Problem with inpage link

Discussion in 'HTML' started by Darko, Jul 30, 2007.

  1. Darko

    Darko Guest

    Hi,

    I have a problem with <a name="..."></a>, <h2 id="...">...</h2>, or
    whatever I put it like. This is the scenario:

    I page 2.html, I have the following code:
    <a name="video"></a>
    <h2>Video</h2>

    I would like to jump from page 1.html into 2.html, to location video.
    So I put the code:
    <a href="2.html#video">video</a>
    into 1.html.

    Now, these are just examples, actually it's help.php?
    sec=mainPage#structure, but I hope that doesn't matter. The problem
    is, when I click on the link "video" in 1.html, I get transferred to
    2.html, but on the top of the page. The absurd thing is that now when
    I'm on the top of this page, when I just focus on the address bar as
    it is and press enter, it jumps into right position. What do I do
    wrong?
    Darko, Jul 30, 2007
    #1
    1. Advertising

  2. Darko

    rf Guest

    "Darko" <> wrote in message
    news:...
    > Hi,
    >
    > I have a problem with <a name="..."></a>, <h2 id="...">...</h2>, or
    > whatever I put it like. This is the scenario:
    >
    > I page 2.html, I have the following code:
    > <a name="video"></a>
    > <h2>Video</h2>
    >
    > I would like to jump from page 1.html into 2.html, to location video.
    > So I put the code:
    > <a href="2.html#video">video</a>
    > into 1.html.
    >
    > Now, these are just examples, actually it's help.php?
    > sec=mainPage#structure, but I hope that doesn't matter. The problem
    > is, when I click on the link "video" in 1.html, I get transferred to
    > 2.html, but on the top of the page. The absurd thing is that now when
    > I'm on the top of this page, when I just focus on the address bar as
    > it is and press enter, it jumps into right position. What do I do
    > wrong?


    1) Provide a URL that demonstrates the behaviour, or the misbehaviour, you
    are experiencing.

    2) Try to provide some coherant explanations of what your problem is.

    --
    Richard.
    rf, Jul 30, 2007
    #2
    1. Advertising

  3. Darko

    Darko Guest

    On Jul 30, 2:37 pm, "rf" <> wrote:
    > "Darko" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi,

    >
    > > I have a problem with <a name="..."></a>, <h2 id="...">...</h2>, or
    > > whatever I put it like. This is the scenario:

    >
    > > I page 2.html, I have the following code:
    > > <a name="video"></a>
    > > <h2>Video</h2>

    >
    > > I would like to jump from page 1.html into 2.html, to location video.
    > > So I put the code:
    > > <a href="2.html#video">video</a>
    > > into 1.html.

    >
    > > Now, these are just examples, actually it's help.php?
    > > sec=mainPage#structure, but I hope that doesn't matter. The problem
    > > is, when I click on the link "video" in 1.html, I get transferred to
    > > 2.html, but on the top of the page. The absurd thing is that now when
    > > I'm on the top of this page, when I just focus on the address bar as
    > > it is and press enter, it jumps into right position. What do I do
    > > wrong?

    >
    > 1) Provide a URL that demonstrates the behaviour, or the misbehaviour, you
    > are experiencing.
    >
    > 2) Try to provide some coherant explanations of what your problem is.
    >
    > --
    > Richard.


    I can't provide any address, since the site isn't published yet, and
    it's inside our local network.

    What does "coherant" mean? Did you mean coherent? :) Just kidding. I
    don't know what else to say except for what I've already said. I show
    you the source of both files and described the behaviour. What else?

    I even thought my browser makes the problem, but it doesn't - for
    other sites it works fine. I think it's just some sort of stupid
    problem.
    Darko, Jul 30, 2007
    #3
  4. Darko

    Darko Guest

    On Jul 30, 2:37 pm, "rf" <> wrote:
    > "Darko" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi,

    >
    > > I have a problem with <a name="..."></a>, <h2 id="...">...</h2>, or
    > > whatever I put it like. This is the scenario:

    >
    > > I page 2.html, I have the following code:
    > > <a name="video"></a>
    > > <h2>Video</h2>

    >
    > > I would like to jump from page 1.html into 2.html, to location video.
    > > So I put the code:
    > > <a href="2.html#video">video</a>
    > > into 1.html.

    >
    > > Now, these are just examples, actually it's help.php?
    > > sec=mainPage#structure, but I hope that doesn't matter. The problem
    > > is, when I click on the link "video" in 1.html, I get transferred to
    > > 2.html, but on the top of the page. The absurd thing is that now when
    > > I'm on the top of this page, when I just focus on the address bar as
    > > it is and press enter, it jumps into right position. What do I do
    > > wrong?

    >
    > 1) Provide a URL that demonstrates the behaviour, or the misbehaviour, you
    > are experiencing.
    >
    > 2) Try to provide some coherant explanations of what your problem is.
    >
    > --
    > Richard.


    Yeah, it was stupid problem. I had a div that I put all the contents
    into, and made that div display:none. When the page loaded, I made the
    div visible so the user doesn't see elements arranging while the page
    is not fully loaded. So, the Firefox probably tried to go to '#video'
    the moment it got on the page, but it wasn't there until I showed the
    div.

    Thanks anyway
    Darko, Jul 30, 2007
    #4
  5. Darko

    rf Guest

    "Darko" <> wrote in message
    news:...
    > On Jul 30, 2:37 pm, "rf" <> wrote:
    >> "Darko" <> wrote in message


    > Yeah, it was stupid problem. I had a div that I put all the contents
    > into, and made that div display:none. When the page loaded, I made the
    > div visible so the user doesn't see elements arranging while the page
    > is not fully loaded


    WHAT?

    I can only presume you make the div visible using javascript. That means
    that the 10% or so of people who don't have javascript will never see your
    div. Just like turning your server off for one month a year.

    BTW coherant was a typo. We all make them sometimes. The polite people don't
    notice them, except if they are in a web page up for review :)

    --
    Richard.
    rf, Jul 30, 2007
    #5
  6. Darko wrote:
    > On Jul 30, 2:37 pm, "rf" <> wrote:
    >> "Darko" <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >>> Hi,
    >>> I have a problem with <a name="..."></a>, <h2 id="...">...</h2>, or
    >>> whatever I put it like. This is the scenario:
    >>> I page 2.html, I have the following code:
    >>> <a name="video"></a>
    >>> <h2>Video</h2>


    For what it is worth, rather than use the named empty anchor, just set
    the H2 element's ID to the fragment:

    <h2 id="video">Video</h2>

    then link <a href="2.html#video">video</a> should work. Why you are
    currently having problem one can only guess because we cannot *see* what
    you are doing....

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jul 30, 2007
    #6
  7. Darko

    Darko Guest

    On Jul 30, 3:19 pm, "rf" <> wrote:
    > "Darko" <> wrote in message
    >
    > news:...
    >
    > > On Jul 30, 2:37 pm, "rf" <> wrote:
    > >> "Darko" <> wrote in message

    > > Yeah, it was stupid problem. I had a div that I put all the contents
    > > into, and made that div display:none. When the page loaded, I made the
    > > div visible so the user doesn't see elements arranging while the page
    > > is not fully loaded

    >
    > WHAT?
    >
    > I can only presume you make the div visible using javascript. That means
    > that the 10% or so of people who don't have javascript will never see your
    > div. Just like turning your server off for one month a year.
    >
    > BTW coherant was a typo. We all make them sometimes. The polite people don't
    > notice them, except if they are in a web page up for review :)
    >
    > --
    > Richard.


    Yes, I agree anyone who doesn't have javascript will not see my page,
    but my page
    is such that even if they *say* my div, not having javascript they
    will have absolutely
    no use of it, since the page uses around 160KB of javascript code.
    It's aimed only at
    people who have it, and if they turned it off they can turn it on, and
    if they don't have
    it then they can get it :)

    The notice of the typo was just a joke.
    Darko, Jul 31, 2007
    #7
  8. Darko

    Darko Guest

    On Jul 30, 4:51 pm, "Jonathan N. Little" <>
    wrote:
    > Darko wrote:
    > > On Jul 30, 2:37 pm, "rf" <> wrote:
    > >> "Darko" <> wrote in message

    >
    > >>news:...

    >
    > >>> Hi,
    > >>> I have a problem with <a name="..."></a>, <h2 id="...">...</h2>, or
    > >>> whatever I put it like. This is the scenario:
    > >>> I page 2.html, I have the following code:
    > >>> <a name="video"></a>
    > >>> <h2>Video</h2>

    >
    > For what it is worth, rather than use the named empty anchor, just set
    > the H2 element's ID to the fragment:
    >
    > <h2 id="video">Video</h2>
    >
    > then link <a href="2.html#video">video</a> should work. Why you are
    > currently having problem one can only guess because we cannot *see* what
    > you are doing....
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com


    Yes, I know, but as far as I can remember, some browsers (was it IE6?
    I can't remember) had problems with just ids. So I ended with
    giving both id and name to h2, if that won't work, I will make it
    <a name="..."></a>
    <h2 id="...">...</h2>

    Hopefully that'll work. Thanks
    Darko, Jul 31, 2007
    #8
  9. Darko

    Bergamot Guest

    Darko wrote:
    > On Jul 30, 4:51 pm, "Jonathan N. Little" <>
    > wrote:
    >> For what it is worth, rather than use the named empty anchor, just set
    >> the H2 element's ID to the fragment:

    >
    > Yes, I know, but as far as I can remember, some browsers (was it IE6?
    > I can't remember) had problems with just ids.


    FYI, it was Netscape 4.x, a browser (thankfully) long dead and buried.

    --
    Berg
    Bergamot, Jul 31, 2007
    #9
  10. l o l
    Information Man, Jul 31, 2007
    #10
    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. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    810
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    460
    Eki Y. Baskoro
    Dec 18, 2003
  3. Dan M
    Replies:
    5
    Views:
    420
  4. kolesdz
    Replies:
    9
    Views:
    527
    Blinky the Shark
    Aug 22, 2007
  5. JMB
    Replies:
    10
    Views:
    204
Loading...

Share This Page