I use JQuery to get Json data, but the data it display has double quotes. It there a function to remove it?
$('div#ListingData').text(JSON.stringify(data.data.items[0].links[1].caption))
it returns:
"House"
How can I remove the double quote? Cheers.
Use replace:
replace
var test = ""House""; console.log(test); console.log(test.replace(/"/g, "")); // "House" // House
Note the g on the end means "global" (replace all).
g
1.4m articles
1.4m replys
5 comments
56.9k users