[jQuery] Re: accessing elements with . in their ids without escaping

2008-03-24 Thread Brian Cherne
I haven't tested this, but try

$(   document.getElementById('123.123')   )

Also note that according to the specification IDs must start with a letter
([a-zA-Z])... It sounds like even changing a period is difficult enough so
this might be a similarly difficult task given your code/data. I remember
(only vaguely) in some situations that deviating from the ID spec causes
issues. Good luck!

http://www.w3.org/TR/html401/types.html#type-name

Brian.

On Mon, Mar 24, 2008 at 11:00 AM, Harald Armin Massa 
[EMAIL PROTECTED] wrote:


 hello,

 I am in the process of moving to jQuery.

 One challenge is: many of the relevant IDs of Elements have one or
 more dots within them.

 I read within the FAQ that I can escape them when using the $(#some\
 \.id) selector.

 Is there another possible way, like $().getelementbyid(#123.123) ?
 or is there an escaping-function allready in the wild? Or do I have
 to come up with my own escaping function?

 Best wishes

 Harald



[jQuery] Re: accessing elements with . in their ids without escaping

2008-03-24 Thread Karl Rudd

If you have the raw (ie blah.blah) you could just alias the
document.getElementById function:

function getId( id ) { return document.getElementById( id ); }

Or if you have the ids in CSS form (ie #blah.blah):

function getId( id ) { return document.getElementById( id.substr(1) ); }

And then use it like:

$( getId( 'blah.blah' ) )...

Karl Rudd

On Tue, Mar 25, 2008 at 5:00 AM, Harald Armin Massa
[EMAIL PROTECTED] wrote:

  hello,

  I am in the process of moving to jQuery.

  One challenge is: many of the relevant IDs of Elements have one or
  more dots within them.

  I read within the FAQ that I can escape them when using the $(#some\
  \.id) selector.

  Is there another possible way, like $().getelementbyid(#123.123) ?
  or is there an escaping-function allready in the wild? Or do I have
  to come up with my own escaping function?

  Best wishes

  Harald



[jQuery] Re: accessing elements with . in their ids without escaping

2008-03-24 Thread chrismarx

this works, but maybe there is also an easier way out there somewhere-

$([id='something.somethingelse'])

On Mar 24, 2:00 pm, Harald Armin  Massa [EMAIL PROTECTED]
wrote:
 hello,

 I am in the process of moving to jQuery.

 One challenge is: many of the relevant IDs of Elements have one or
 more dots within them.

 I read within the FAQ that I can escape them when using the $(#some\
 \.id) selector.

 Is there another possible way, like $().getelementbyid(#123.123) ?
 or is there an escaping-function allready in the wild? Or do I have
 to come up with my own escaping function?

 Best wishes

 Harald


[jQuery] Re: accessing elements with . in their ids without escaping

2008-03-24 Thread Klaus Hartl

Escape like:

'#123.123'.replace(/\./g, '.'); // = #123\\.123


---Klaus


On Mar 24, 7:00 pm, Harald Armin  Massa [EMAIL PROTECTED]
wrote:
 hello,

 I am in the process of moving to jQuery.

 One challenge is: many of the relevant IDs of Elements have one or
 more dots within them.

 I read within the FAQ that I can escape them when using the $(#some\
 \.id) selector.

 Is there another possible way, like $().getelementbyid(#123.123) ?
 or is there an escaping-function allready in the wild? Or do I have
 to come up with my own escaping function?

 Best wishes

 Harald