PDA

View Full Version : How to do in javaScript



Basavaraj
Mar 20th, 2007, 08:31 AM
Hi friends please help me

var = ' wel ' co " me ';

i want to display it like a 'welcome' please help me out how to display using javascript without error

if i use replace(/\"|\'/g, "") it's not working
please help me

Philip M
Mar 20th, 2007, 09:49 AM
I have already answered this for you at
http://www.codingforums.com/showthread.php?t=110050
Why have you started another thread?

A variable must have a name:- var thevariableName = ' wel ' co " me ';

And you cannot have an odd number (or more than two) ' or " in the string.
In short, ' wel ' co " me ' is not a valid expression. The second ' terminates the string. 'wel "com" e' is valid.

Why do you want to do this anyway?