97
rated 0 times
[
101]
[
4]
/ answers: 1 / hits: 63634
/ 10 Years ago, tue, october 7, 2014, 12:00:00
I want to create a JSON string inside a JSON request. Here is my code,
JS
var x = {
a: 1,
b: 'a sample text',
};
var request = {
t: JSON.stringify(x),
c: 2,
r: 'some text'
};
console.log(request);
Can someone help me how to escape the double quotes?
Console
Object {
t: {a:1,b:a sample text}, //This creates a problem, double quotes inside double quotes.
c: 2,
r: some text
}
Thanks in advance.
More From » json