<div> 나 <p> 태그안에 예제코드를 넣고싶은데 소스로 인식되는 현상 채택완료
유닛룽
10년 전
조회 4,101
서버에서 예제코드를 받아와 뿌리는도중에 cs 나 json 같은 형식은 잘 나오는 반면 xml 은 자꾸 태그로 인식됩니다..
</p><p>//aspx 파일 (view파일) 에서 정의되어있는 div</p><p><div class='example_code'></p><p><<span style="font-size: 10pt; line-height: 1.5;">/div></span></p><p><span style="font-size: 10pt; line-height: 1.5;"> </span></p><p><span style="font-size: 10pt; line-height: 1.5;">//javascript 파일에서 append 시켜줄 예정</span></p><p><span style="font-size: 10pt; line-height: 1.5;"></span><span style="font-size: 13.3333330154419px; line-height: 1.5;">var ex_Text=</span><span style="font-size: 13.3333330154419px; line-height: 1.5;">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rsp stat=\"ok\">\n\t<MaxStora</span><span style="font-size: 13.3333330154419px; line-height: 1.5;"> </span><span style="font-size: 13.3333330154419px; line-height: 1.5;">…</span><span style="font-size: 13.3333330154419px; line-height: 1.5;"> </span><span style="font-size: 13.3333330154419px; line-height: 1.5;">…</span><span style="font-size: 13.3333330154419px; line-height: 1.5;"> ></span><span style="font-size: 10pt; line-height: 1.5;">"</span><span style="font-size: 10pt; line-height: 1.5;"></span><span style="font-size: 10pt; line-height: 1.5;"></span></p><p>$(".example_code").append("<p>"+ex_Text+"</p>");</p><p><span style="font-size: 10pt; line-height: 1.5;"> </span></p><p><span style="font-size: 10pt; line-height: 1.5;">
이렇게 예제코드를 넣고싶은데
<?xml 이 소스태그로 인식되버려서요 ㅠㅠ
어떻게 검색해야되는지 감이 안잡혀서 이렇게 질문 남깁니다..
이렇게 의도치않은 문장이 태그로 인식될때는 어떤 방법을 써야하나요??
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
10년 전
http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery">http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
참고해 보세요
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인