anam
anam

Reputation: 3913

store newline character with string in a variable

I have stored this string in xml ... reading it in a ariabel and then printing with below code

 $("#"+obj.id +" .frontText").html("<h2>"+fTitle[origImg]+"</h2>"+"<br/>"+backText[origImg]);

I want to print newline in this backtext . how to do thid i tried \n,
bute the are not working.

Code::

   <backTxt>HarbourFront Tower One is an 18-storey office buillding which houses many blue-chip multinational corporations.                            
        It was developed as part of the HarbourFront Precinct rejuvenation project to meet the growing demand of businesses relocating to the fringe of the CBD. 
The development is located near supporting amenities and public transport.
</backTxt>   

I want to Print like This :

HarbourFront Tower One is an 18-storey office buillding which houses many blue-chip multinational corporations.
It was developed as part of the HarbourFront Precinct rejuvenation project to meet the growing demand of businesses relocating to the fringe of the CBD. The development is located near supporting amenities and public transport.

Upvotes: 1

Views: 347

Answers (1)

Samuel Lindblom
Samuel Lindblom

Reputation: 819

You are outputting HTML code and HTML uses <br> to denote a line break, so that is what you will need to output.

Upvotes: 3

Related Questions