Server Side simple quote vs double quotes
Server Side simple quote vs double quotes
Hello all,
Hello Allan,
I have a little issue with the datatable 1.6 with the server side mode.
Datable with response using simple quote doesn't work.
Short example 1:
[code]
{'sEcho': 1,
'iTotalRecords': 11,
'iTotalDisplayRecords': 11,
'sColumns': 'name1,name2,name3',
'aaData': [['93','2009-10-01 12:10:22','Kioo']]
}
[/code]
But the same example with double quote is great.
Short example 2:
[code]
{"sEcho": 1,
"iTotalRecords": 11,
"iTotalDisplayRecords": 11,
"sColumns": "name1,name2,name3",
"aaData": [["93","2009-10-01 12:10:22","Kioo"]]
}
[/code]
I really need simple quote (like example 1) to push html and some others stuffs.
Can you help me, please ?
Regards.
Sorry for my poor english.
Hello Allan,
I have a little issue with the datatable 1.6 with the server side mode.
Datable with response using simple quote doesn't work.
Short example 1:
[code]
{'sEcho': 1,
'iTotalRecords': 11,
'iTotalDisplayRecords': 11,
'sColumns': 'name1,name2,name3',
'aaData': [['93','2009-10-01 12:10:22','Kioo']]
}
[/code]
But the same example with double quote is great.
Short example 2:
[code]
{"sEcho": 1,
"iTotalRecords": 11,
"iTotalDisplayRecords": 11,
"sColumns": "name1,name2,name3",
"aaData": [["93","2009-10-01 12:10:22","Kioo"]]
}
[/code]
I really need simple quote (like example 1) to push html and some others stuffs.
Can you help me, please ?
Regards.
Sorry for my poor english.
This discussion has been closed.
Replies
Allan
But I can't escape my string due to xsl transformation. The result database is transform in xsl before send to the client.
Or I didn't find how to escape in xsl with a compatibility with jSon. :)
In fact, my code looks like this:
[code]
{
'sEcho': 1,
'iTotalRecords': ,
'iTotalDisplayRecords': ,
'sColumns': 'name1,name2,name3',
'aaData': [
['',
'',
'go to'
],
]}
[/code]
Thank you for your help.
[code]
{
"sEcho": 1,
"iTotalRecords": ,
"iTotalDisplayRecords": ,
"sColumns": "name1,name2,name3",
"aaData": [
["",
"",
"go to"
],
]}
[/code]
Thanks Allan, JSON must have double quote.
jQuery 1.4 with the last firefox uses the native JSON parser.
I tried to disable it with the next command
[code]
/* this should be the very first JavaScript inclusion file */
window.JSON = null;
[/code]
But it doesn't work too.
I suggest posting this question in an XSLT forum. I'm no expert on the subject I'm sorry to say (although have used a 'replace' function in XSL before for what little I have done, so it should be possible to escape the strings). Sorry I can't help more.
Regards,
Allan