My jQuery script as below:
jQuery.ajax({
type:"GET",
url:url,
data:'action=getStatus',
}).done(function(response){
var data = jQuery.parseJSON(response);
var test = data['visitor_chart'];
})
My jQuery.ajax return response in below form:
"{"visitor_chart":"{y: 3, label: \"2015-07-21\"}, {y: 1, label: \"2015-07-29\"}, {y: 1, label: \"2015-07-30\"}, {y: 1, label: \"2015-08-01\"}","visitor_count":6,"enquiry_count":1}"
After parseJSON I got data['visitor_chart'] in below form:
"{y: 3, label: "2015-07-21"},{y: 1, label: "2015-07-29"},{y: 1, label: "2015-07-30"},{y: 1, label: "2015-08-01"}"
but I want to strip first and last quote from this string.
How to do that?
data['visitor_chart']in an API as a argument, for this I want to remove first and last quotes.jQuery.parseJSON(data['visitor_chart'])