I want to return some results in my react code by using ajax, now I should use line break in my second page and return the result but i cant use <br/>
because my result shows tags like this : hi br/ hi
. How can I insert line break without any html tag? my ajax code :
$.ajax({
'async': false,
'type': "POST",
'global': false,
'dataType': 'html',
'url': "barRules.bc",
'data': { 'id': JSON.stringify(id) },
'success':(response)=>{
tmp = response;
}
});
my second page : " @Field : br/ @value / "
Use the white-space
css property and set it to pre-line
so that new lines are preserved in the html.
.keep-new-line{
white-space: pre-line;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.