Maintaining Line Breaks Through Facebook API Usage
When using the api and javascript to display the description of an event, h开发者_如何学运维ow can i preserve the line breaks?
query.wait(function(rows) {
document.getElementById('debug').innerHTML =
new Date(rows[0].start_time * 1000) + "<br />" +
rows[0].start_time + "<br />" +
rows[0].end_time + "<br />" +
rows[0].location + ", " +
rows[0].venue['street'] +
rows[0].venue['city'] + ", " +
rows[0].venue['state'] + "<br />" +
rows[0].description;
;
});
You can use a <pre>
element to preserve white space characters, such as \t
and \n
.
精彩评论