2011-05-13 10 views
0

개발자 도구에서 예기치 않은 토큰 스크립트 오류가 계속 발생합니다. (fixed) 이제는 내 멋진 함수가 내 사건에 사용되는 것과 관련된 오류가 발생합니다. Uncaught SyntaxError : 예기치 않은 식별자.스크립트 끝 부분에 예기치 않은 토큰이 있습니다.

<script type="text/javascript"> 
    $(document).ready(function() { 
     $("select[name=highSchool]").change(function() { 
      switch ($("select[name=highSchool]").val()) { 
       case 'Not yet attending': 
        $(this).parent().parent().sibling("tr#currentGrade").children("td#currentGrade").html(
        "{html_options name='currentGrade' options=$currentGrade}"); 
       break; 
       case 'Attending': 
        $(this).parent().parent().sibling("tr#currentGrade").children("td#currentGrade").html(""); 
       break; 
       default: 
       $(this).parent().parent().siblings("tr#currentGrade").children("td#currentGrade").html(""); 
      } 
     }); 
    }); 
</script> 
+0

PHP는 클라이언트가 페이지에 넣기 때문에 Smarty 함수를 처리하지 않습니다. – drudge

+0

당신 말이 맞습니다. 도와 줘서 고마워. – wowzuzz

답변

3

마지막에서 두 번째 라인이 있어야한다 : }); 그렇지 않으면 당신의 .change()이 닫히지 않은 남아 있습니다.

+0

그게 효과가! 고맙습니다 :) 멋진 기능을 추가하면 "{html_options name = 'currentGrade'options = $ currentGrade} '); 예상 된 식별자가 2 번 반복되었다는 또 다른 오류가 발생합니다. – wowzuzz

+0

@wowzuzz : 구문 강조 기능이있는 텍스트 편집기가 많은 도움이됩니다. :) – drudge

+0

원래 질문을 편집하여 Smarty 기능을 어디에 두 었는지 확인할 수 있습니까? – drudge

관련 문제