I have a string of JSON data and I need to replace every comma with a <br> in javascript.
Here is my JSON {"Items":"beans ,rice ,flour","Quantity":"4 ,5 ,6"}
And my JSON call
jQuery(document).ready(function($) {
$.get( url, function( data ) {
$.each( data, function( i, val ) {
$( "#pantry" ).append(
'<h3>' +
'<p>' +
items +
'</p>' +
'<p>' +
val +
'</p>' +
'</h3>'
);
});
});
});
What do I need to add as a modifier?