2012-11-06 1 views
0

이 항목에 대한 다른 게시물을 확인했지만 그 중 누구도 내 문제와 일치하지 않습니다. 여기ICanHaz 서식 파일을 찾을 수 없음

<script id ="postingcell" type="text/html"> 
    <li class="postinglistcell"> 
     <div class = "postinfowrapper"> 
      <table class="centermargins"> 
       <tr> 
        <td> 
         <div class="posttitle">{{Title}}</div> 
        </td> 
       </tr> 
      </table> 
     </div> 
    </li> 
</script> 

그리고 나는 ICH 전화 코드입니다 : 여기에 내 템플릿의 코드는

$(document).ready(function() { 
    var p = ich["postingcell"](thisobj); 
}); 

내가 오류 ich["postingcell"]가 정의되어 있지 않은 것을 말해을 얻을 수는 있지만,있다 위 스크립트 태그에서 아무도 내가 여기서 잘못하고있는 것을 아는 사람이 있습니까?

+0

이 보이는합니다. 이것은 정확히 동일한 코드입니까? –

+0

그것은 ...하지만 그 공간은 문자열 바로 바깥에있는 한 중요하지 않아야합니까? – dopatraman

답변

3

ICanHaz도 jQuery를 사용하여 설정합니다. 한 가지 가능한 이유는 ich.grabTemplates() 호출 전에 코드가 실행된다는 것입니다.

if (ich.$) { 
    ich.$(function() { 
     ich.grabTemplates(); 
    }); 
} 

당신은 코드에서 ich.grabTemplates() 호출하려고 할 수 있습니다 : 당신이 id`와`= "postingcell"``사이에 공백을 가지고있는 것처럼

$(document).ready(function() { 
    ich.grabTemplates(); 
    var p = ich["postingcell"](thisobj); 
});