How to avoid single and double quotes in DataTable
How to avoid single and double quotes in DataTable
Vamshikrishna
Posts: 1Questions: 0Answers: 0
i am facing some issue because of single (') and double (") quotes in Jquery datatable if one of the field contain single (') and double (") it is throwing Expected ")" here is my Jquery datatable code
$('#searchcustomerData').DataTable(
{
"bServerSide" : false,
"oLanguage" : {
"sEmptyTable" : datatableMessage
},
"aaData" :values,
"aoColumns" : [ {
"mData" : "customerId" ,
className : "center"
}, {
"mData" : "cifNo",
className : "center"
}, {
"mData" : "groupId",
className : "center"
},
{
"mData" : "engFullName",
className : "center"
},
{
"mData" : "thaiFullName",
className : "center"
},
{
"mData" : "priIdNumber",
},
{
"mData" : "guarantorFlag",
className : "center",
},
],
can u please solve this
thanks in advance.
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Replies
what fields? Your data fields? There should be no issues unless your embedded strings are not properly escaped.
There is no difference between single quotes and double quotes in Javascript (other than quoting as @bindrid says).
Can you link to a page showing the issue please?
Allan