I recently found out about .json files and I am trying to put a multiline string inside a data value, but it is just simply not working. I've tried \n and \r and \n\r but none work when they get put into my div from jquery.
Am I missing something here? This is my json file:
{
"lText": "space\nbreak",
}
And here is my javascript:
$.getJSON("/js/content.json", function (data) {
$(".lander .title").text(data.lTitle);
$(".lander .subtitle").text(data.lSubtitle);
$(".lander .text").text(data.lText);
});
tag inside the json file just renders the br tag in the document. – Sebastian Olsen Jul 09 '15 at 02:13