Javascript browser detection

T

Tharnack

Hi,
I have some html code i would like to be printed to the page only if the
browser has javascript enabled. I have tried to use document.writeln()
but the string i want to print bot contains some ' and " in it. I don't
know how to set the delimiters of the string that is passed as argument
so that i don't get an error in the page.
 
I

Ivo

I have some html code i would like to be printed to the page only if the
browser has javascript enabled. I have tried to use document.writeln()
but the string i want to print bot contains some ' and " in it. I don't
know how to set the delimiters of the string that is passed as argument
so that i don't get an error in the page.

" can be escped as \" or " or "
' can be escaped as \' or ' or '

document.write( ' Funny, isn \' t it? ' );
HTH
Ivo
 

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
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top