Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

escape comma in javascript function

Status
Not open for further replies.

YYYYUU

Programmer
Dec 13, 2002
47
GB
I can't change any of the following so I need to escape the comma. Any ideas how to do this? I know for ' it's \'.

addComp('T22', 'freddy,asdf bob\'s asdf')

function addComp(code,name)
{
sComps+=code+','+name+',';
}


Thanks for your help.
 
why would u want to escape commas??? there is no need for that in JS...

Known is handfull, Unknown is worldfull
 
why would u want to escape commas??? there is no need for that in JS...

Known is handfull, Unknown is worldfull
 
Hello YYYYUU,

If it is remotely related to adsi, it is "\" as well, ie,
freddy\,asdf

regards - tsuji
 
Trust me I do need to escape this. I'm using xsl. \, doesn't work
 
try this:
sComps+='"'+code+','+name+'"';

since its xls it might work...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top