Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jul 01, 2008 03:51
open dhtmlx forum
Single quote in the string of header


Hi,
I'm having a grid containing a link in the column header. The link works perfectly fine. But when the value in the link contains the '(Single Quote) in the middle, and when we try to click on the link in the header, then an error is thrown saying ")" is expected. The sample of the code is displayed below.

sFieldName = "I'm New"
sFieldName = Replace(sFieldName, "'", "\'")
sSortString = sFieldName

Response.Write "<column width=""100"" type=""" & sFieldType & """ align=""left"" color=""white"" sort=""na"">" & _
"<![CDATA[<a href=""javascript:Function(\'" & sSortString & "\'\\,\'" & ORDER & "\')"">" & sFieldName & "</a>]]></column>"

Please suggest me on how to make a link work if it contains a '(Single Quote).
Answer posted by Support on Jul 01, 2008 04:00
From javascript perspecitve - the single quote character has not any special meaning and treated in default way
The problem caused by the way how you build inline js command and not related to component itself.