[Error] Youtube API title ' 오류

sungeun·2022년 11월 7일
0
post-thumbnail

문제 : Youtube API로 동영상을 가져오는데 title의 '' 로 표출되는 오류 발생.

해결 : he.js 패키지를 다운받아서 해결.

  1. npm i he 로 패키지 다운.
  2. 레이아웃에 <script src="<c:url value="/[경로]/js/he.js" />"></script> 추가.
  3. API 호출 jsp에 titlehe.decode() 로 감싸줌.
    Handlebars.registerHelper('decode', function(title) {
        return he.decode(title);
    });
profile
Back-end Developer

0개의 댓글