By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,692 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,692 IT Pros & Developers. It's quick & easy.

reserved ids?

P: n/a
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 ni**@maproom.co.uk
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Nick Wedd wrote:
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?


No ideas are reserved AFAIK.

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

document.getElementById('p')

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #2

P: n/a
VK
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 <ni**@maproom.co.uk> wrote in message
news:3F**************@maproom.demon.co.uk...
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 ni**@maproom.co.uk

Jul 20 '05 #3

P: n/a
In message <bm*******************@news.demon.co.uk>, David Dorward
<do*****@yahoo.com> writes
Nick Wedd wrote:
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?


No ideas are reserved AFAIK.

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

document.getElementById('p')


That is what I am doing.
document.getElementById('a')
works. So does most other single letters.
document.getElementById('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 ni**@maproom.co.uk
Jul 20 '05 #4

P: n/a
Nick Wedd <ni**@maproom.co.uk> writes:
Non-working ids that I have found are 'i', 'p', 'q'.


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

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

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


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

Jul 20 '05 #6

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.de> writes:
VK wrote:

So you can assign an id="#$%^&*(" and nobody will care except
Dreamweaver and some other authoring programs (but not browsers).


You're sure?


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:yellow;}
</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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #7

P: n/a
In message <pt**********@hotpop.com>, Lasse Reichstein Nielsen
<lr*@hotpop.com> writes
Nick Wedd <ni**@maproom.co.uk> writes:
Non-working ids that I have found are 'i', 'p', 'q'.


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


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 ni**@maproom.co.uk
Jul 20 '05 #8

P: n/a
Nick Wedd <ni**@maproom.co.uk> writes:
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.


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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #9

P: n/a
In message <is**********@hotpop.com>, Lasse Reichstein Nielsen
<lr*@hotpop.com> writes
Nick Wedd <ni**@maproom.co.uk> writes:
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.


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" :)


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 ni**@maproom.co.uk
Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.