Whats the trick for special characters?

R

Richard

In using a variable message format such as content[1]='it's a small world'

How exactly is the inner ' shown in the coding?
I tried 'it&acutes' which does not work.
Neither does 'it'+&acute+'s'.

Just being curious. Not that it matters that much.

thanks again.
 
E

Evertjan.

Richard wrote on 31 jan 2005 in comp.lang.javascript:
In using a variable message format such as content[1]='it's a small
world'

How exactly is the inner ' shown in the coding?
I tried 'it&acutes' which does not work.
Neither does 'it'+&acute+'s'.

Just being curious. Not that it matters that much.

If it doesn't matter much, shall we leave it at that?

===============

perhaps for others than the OP:

content[1] = "it's a small world" // using double quoted string

content[2] = 'it\'s a small world' // escaped

content[3] = 'it\047s a small world' // octal ascii

content[4] = 'it' + String.fromCharCode(39) + 's a small world'
// String object decimal ascii

etc.
 
R

Richard

Richard wrote on 31 jan 2005 in comp.lang.javascript:
In using a variable message format such as content[1]='it's a small
world'
How exactly is the inner ' shown in the coding?
I tried 'it&acutes' which does not work.
Neither does 'it'+&acute+'s'.
Just being curious. Not that it matters that much.

If it doesn't matter much, shall we leave it at that?
===============

perhaps for others than the OP:
content[1] = "it's a small world" // using double quoted string
content[2] = 'it\'s a small world' // escaped
content[3] = 'it\047s a small world' // octal ascii
content[4] = 'it' + String.fromCharCode(39) + 's a small world'
// String object decimal ascii

Thanks for the info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,688
Members
48,796
Latest member
Greg L.

Latest Threads

Top