I am searching for anyone with experience creating line breaks with SQLite. I have a field in my localized database with several sentences. I have tried numerous options to create line breaks after each sentence from setting mySQL field type to text, doing a query to concatenate, and simply just adding "\n" or "<br>" after the sentence. My last resort was to use javascript to replace each period with a <br> but alas that did not work.
My problem is that each line break method that I have attempted just displays on the front-end. Can anyone assist me in creating a line break in the back-end or suggest something if you have an idea of how to fix this problem? Thanks much!
Below is my code of how I am displaying the front-end:
<div id="tips-ctn">
<a id="tips-link" href="#tipsPopup" data-rel="popup" class="ui-btn ui-corner-all ui-btn-icon-right ui-icon-carat-d" data-transition="pop">Healthy Tips</a>
<div data-role="popup" id="tipsPopup" data-arrow="t">
<p id="tips-text"></p>
</div>
</div>
Javascript back-end:
treat.Tips = treat.Tips.replace(/\./g, "<br>");
$("#tips").append("<li class='treatment'>" + treat.Tips + "</li>");
$("#tips-text").text(treat.Tips);
$('#tips').listview('refresh');
Aucun commentaire:
Enregistrer un commentaire