2013-08-01 3 views
0

이 결과를 얻을하는 방법이 코드에 라인을 중단하는 방법

if (imageTextContainer.length > 0) { 
    imageTextContainer.text(imageItem.text +imageItem.dec); 
} 

:

imageItem.text </br> imageItem.dec 

이 코드 ::

{ 
    image : "<?php bloginfo('template_directory'); ?>/pictures/1.jpg", 
    alt : "Picture 1", 
    dec : "rockstar games", 
    text : "Grand Theft Auto San Andres\r\n" 
} 

\r\n 작동하지 않습니다. 에코 공간

+0

에 오신 것을 환영합니다. [코드 샘플'{}'] (http://i.stack.imgur.com/VYd26.png) 툴바 버튼을 사용하여 소스 코드를 포맷 할 수 있습니다. 이번엔 내가 너 한테 해 줬어. –

+0

죄송합니다. 내 영어가 잘못되었습니다. –

답변

1

이 시도 : 스택 오버플로

if (imageTextContainer.length > 0) { 
    imageTextContainer.html(imageItem.text + '<br>' + imageItem.dec); 
} 
+1

고맙습니다. –

-1
if (imageTextContainer.length > 0) { 
    imageTextContainer.html(imageItem.text + "<br />" +imageItem.dec); 
    } 
관련 문제