views:

303

answers:

3

With jQuery, we do it like this:

 $(document).ready(function() {
   $("#orderedlist").append("Please rate: ");
 });

and de string appended to component with id orderedlist.

Using icefaces framework , i got a component with id form1:p i tried accessing it using followin code :

jQuery.noConflict();
jQuery("#form1:p").append("Please rate: ");

the string is appended to the form1 and not to the specified component with id form1:p

+4  A: 

You need to escape the : with two backslashes

jQuery("#form1\\:p").append("Please rate: ");

See the note at the top of the selectors api page

PetersenDidIt
it worked ! thanks a lot !
Fayaz Mammoo
+4  A: 

you need to escape it!

If you wish to use any of the meta-characters (#;&,.+*~':"!^$=>|/ ) as a literal part of a name, you must escape the character with two backslashes: \\

Johnco
it worked ! thanks a lot !
Fayaz Mammoo
A: 

I would assume that the problem is that : is a meta character in css selectors, used for :first and alike. Try it without the colon, i'm just guessing really, not sure if you could escape it, probably.

Paul Creasey
You can escape with two back slashes: "my\\:id"
Kyle Trauberman