Internet Explorer의 모든 버전에서 작동하지 않는 것을 디버깅하려고합니다.Internet Explorer에서이 기능이 작동하지 않는 이유는 무엇입니까? [jQuery, radio, selectors]
여기에 코드입니다 :
<div id="sondage">
<input type="radio" name="reponse" value="oui" id="oui">
<label for="oui">Oui</label>
<input type="radio" name="reponse" value="non" id="non">
<label for="non">Non</label>
</div>
<script type="text/javascript" charset="utf-8">
$(function(){
$('#oui, #non').click(function(){
reponse = $('input[name=reponse]:checked').val();
sondage_id = <?php echo $sondage->id ?>;
$.ajax({
type: "GET",
url: "<?php echo url_for('@sondage_repondre') ?>",
data: "reponse="+reponse+"&id="+sondage_id,
success: function(msg){
resultat = msg.split('|');
if (resultat[0] == "true") {
$('#sondage_message').html("<?php echo __('Merci.') ?>");
} else {
$('#sondage_message').html("<?php echo __('Désolé, vous avez déjà voté pour ce sondage. Merci.') ?>");
}
$('#sondage').html(resultat[1]);
}
});
});
});
</script>
오류가 라인 (reponse = $('input[name=reponse]:checked').val();
)에 발생합니다.
무슨 일이 일어나는지 생각해보십시오.
감사합니다.
편집 : 질문으로 :
Line 511, Char 7, Object doesn't support this property or method.
그리고 여기에 전체 출력의 : 오류는 다시 http://pastie.org/1355610
감사합니다!
오류의 원인이되는 행이 맞습니까? 나는 IE의 라인 번호를 신뢰하지 않지만, 그 값을 하드 코딩하여 검증 할 수있다. 어떤 오류가 발생합니까? 실제 소스 대신 렌더링 된 코드 ("소스보기")로 질문을 업데이트 해 주실 수 있습니까? ' PHP 에코'는 IE가 보는 것이 아니기 때문에 우리에게 많은 도움이되지 않습니다. 예를 들어,'$ sondage-> id'가 문자열이나 빈 값을 생성하면, 이것은 어떤 브라우저에서든 깨질 것입니다. –
당신은 완전히 옳았습니다. 문제를 업데이트했습니다. 감사합니다 :) – TomShreds
IE에서 얻는 오류 메시지는 무엇입니까? – Phrogz