reserved ids?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Wedd

    reserved ids?

    I am having trouble (using IE6, with Windows), in using certain ids for
    my html elements. id="c" works fine. So do most one-letter ids. But
    id="i", and id="p", seem not to work.

    I don't think I am using these identifiers for anything else. My guess
    is that they are reserved. Can I find a list somewhere of reserved ids?

    Nick
    --
    Nick Wedd nick@maproom.co .uk
  • David Dorward

    #2
    Re: reserved ids?

    Nick Wedd wrote:
    [color=blue]
    > I am having trouble (using IE6, with Windows), in using certain ids for
    > my html elements. id="c" works fine. So do most one-letter ids. But
    > id="i", and id="p", seem not to work.
    >
    > I don't think I am using these identifiers for anything else. My guess
    > is that they are reserved. Can I find a list somewhere of reserved ids?[/color]

    No ideas are reserved AFAIK.

    My guess is you are trying to access them as global variables. Try following
    the standards:

    document.getEle mentById('p')

    --
    David Dorward http://dorward.me.uk/

    Comment

    • VK

      #3
      Re: reserved ids?

      There are not any "reserved ids".
      On the papers any id has to start with a letter and consist of letters
      and numbers only.
      On the practice smart guys from 3W put name (which is CDATA type) and id
      in the same name space.
      So browsers have to serve "the biggest possible demand", which is CDATA.
      So you can assign an id="#$%^&*(" and nobody will care except
      Dreamweaver and some other authoring programs (but not browsers).

      So check you code through once again.

      Nick Wedd <nick@maproom.c o.uk> wrote in message
      news:3FTecBHL9w k$EAy0@maproom. demon.co.uk...[color=blue]
      > I am having trouble (using IE6, with Windows), in using certain ids[/color]
      for[color=blue]
      > my html elements. id="c" works fine. So do most one-letter ids.[/color]
      But[color=blue]
      > id="i", and id="p", seem not to work.
      >
      > I don't think I am using these identifiers for anything else. My[/color]
      guess[color=blue]
      > is that they are reserved. Can I find a list somewhere of reserved[/color]
      ids?[color=blue]
      >
      > Nick
      > --
      > Nick Wedd nick@maproom.co .uk[/color]


      Comment

      • Nick Wedd

        #4
        Re: reserved ids?

        In message <bmv3nu$776$1$8 30fa7b3@news.de mon.co.uk>, David Dorward
        <dorward@yahoo. com> writes[color=blue]
        >Nick Wedd wrote:
        >[color=green]
        >> I am having trouble (using IE6, with Windows), in using certain ids for
        >> my html elements. id="c" works fine. So do most one-letter ids. But
        >> id="i", and id="p", seem not to work.
        >>
        >> I don't think I am using these identifiers for anything else. My guess
        >> is that they are reserved. Can I find a list somewhere of reserved ids?[/color]
        >
        >No ideas are reserved AFAIK.
        >
        >My guess is you are trying to access them as global variables. Try following
        >the standards:
        >
        >document.getEl ementById('p')[/color]

        That is what I am doing.
        document.getEle mentById('a')
        works. So does most other single letters.
        document.getEle mentById('p')
        does not work. The elements are similar in all respects but their name
        (and position). If I swap them around, it is still the one with id 'p'
        that does not work. Non-working ids that I have found are 'i', 'p',
        'q'.

        Nick
        --
        Nick Wedd nick@maproom.co .uk

        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: reserved ids?

          Nick Wedd <nick@maproom.c o.uk> writes:
          [color=blue]
          > Non-working ids that I have found are 'i', 'p', 'q'.[/color]

          I have no such problem in my testing. I guess you need to show us the
          page.

          /L
          --
          Lasse Reichstein Nielsen - lrn@hotpop.com
          Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: reserved ids?

            VK wrote:
            [color=blue]
            > There are not any "reserved ids".
            > On the papers any id has to start with a letter and consist of letters[/color]
            ^^^^^^^^^^^^^^^ ^^^^[color=blue]
            > and numbers only.
            > [...]
            > So you can assign an id="#$%^&*(" and nobody will care except[/color]
            ^[color=blue]
            > Dreamweaver and some other authoring programs (but not browsers).[/color]

            You're sure?
            [color=blue]
            > [...][/color]

            Please stop fullquoting and place the quote above your text, not below it.


            PointedEars

            Comment

            • Lasse Reichstein Nielsen

              #7
              Re: reserved ids?

              Thomas 'PointedEars' Lahn <PointedEars@we b.de> writes:
              [color=blue]
              > VK wrote:[/color]
              [color=blue][color=green]
              > > So you can assign an id="#$%^&*(" and nobody will care except
              > > Dreamweaver and some other authoring programs (but not browsers).[/color]
              >
              > You're sure?[/color]

              Pretty sure. Validators will complain, because it isn't valid HTML,
              but the browsers will most likely eat it. Take this example:
              ---
              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
              <html>
              <head>
              <style type="text/css">
              #\23\21 {background:yel low;}
              </style>
              </head>
              <body>
              <p id="#!">Test</p>
              </body>
              </html>
              ---
              It gives yellow background in both Opera 7, Mozilla FB and IE 6.

              /L
              --
              Lasse Reichstein Nielsen - lrn@hotpop.com
              Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
              'Faith without judgement merely degrades the spirit divine.'

              Comment

              • Nick Wedd

                #8
                Re: reserved ids?

                In message <ptgsnsa6.fsf@h otpop.com>, Lasse Reichstein Nielsen
                <lrn@hotpop.com > writes[color=blue]
                >Nick Wedd <nick@maproom.c o.uk> writes:
                >[color=green]
                >> Non-working ids that I have found are 'i', 'p', 'q'.[/color]
                >
                >I have no such problem in my testing. I guess you need to show us the
                >page.[/color]

                I've figured out what was going wrong here. I do have global variables
                called i, p, q. These were messing up the ids of the same name. Maybe
                it should have been obvious that this would happen.

                Nick
                --
                Nick Wedd nick@maproom.co .uk

                Comment

                • Lasse Reichstein Nielsen

                  #9
                  Re: reserved ids?

                  Nick Wedd <nick@maproom.c o.uk> writes:
                  [color=blue]
                  > I've figured out what was going wrong here. I do have global
                  > variables called i, p, q. These were messing up the ids of the same
                  > name. Maybe it should have been obvious that this would happen.[/color]

                  No, it is not obvious. The Javascript global namespace and the HTML
                  ID namespace have no reason to be connected, and many browsers don't.

                  Well, in hindsight, it does feel a little obvious, as in "I should
                  have known this piece of crap would do something as stupid as that" :)

                  /L
                  --
                  Lasse Reichstein Nielsen - lrn@hotpop.com
                  Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
                  'Faith without judgement merely degrades the spirit divine.'

                  Comment

                  • Nick Wedd

                    #10
                    Re: reserved ids?

                    In message <ismjmvj1.fsf@h otpop.com>, Lasse Reichstein Nielsen
                    <lrn@hotpop.com > writes[color=blue]
                    >Nick Wedd <nick@maproom.c o.uk> writes:
                    >[color=green]
                    >> I've figured out what was going wrong here. I do have global
                    >> variables called i, p, q. These were messing up the ids of the same
                    >> name. Maybe it should have been obvious that this would happen.[/color]
                    >
                    >No, it is not obvious. The Javascript global namespace and the HTML
                    >ID namespace have no reason to be connected, and many browsers don't.
                    >
                    >Well, in hindsight, it does feel a little obvious, as in "I should
                    >have known this piece of crap would do something as stupid as that" :)[/color]

                    Now I find that the problem only occurs with undeclared variables. I had
                    thought that there was no point in declaring variables in javascript -
                    now I know better.

                    Nick
                    --
                    Nick Wedd nick@maproom.co .uk

                    Comment

                    Working...