Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
So, I have this problem with trying to make the content within my infoWindow multi-lined. I assumed this would work:
var custContent = customer.Name + '\n' + customer.Address1 + ", " + customer.Locality;
infoWindow.setContent(custContent);


However, much to my chagrin, it does not. The newline character doesn't do anything. It's all just put on one line. Does anyone know how to do this?
Posted
Updated 23-Jun-11 2:54am
v2

According to the online docco here[^], infoWindow.setContent takes any HTML. So, use <br> instead of '\n'.

Peter
If this answers your question, mark it accepted. Vote anyway.
 
Share this answer
 
Comments
Colin Mullikin 24-Jun-11 8:21am    
Yeah, I figured it out yesterday and forgot to come answer the question. I just had to use "<br>" and it worked.
use Carriage return and Line feed
place "\r\n" in place of \n dont use double quotes !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900