Internet Explorerのどのバージョンでも動作しないものをデバッグしようとしています。Internet Explorerでこれが動作しないのはなぜですか? [jQuery、radio、selector]
は、ここでは、コードです:
<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();
)で発生します。
あなたは何が起こっているか考えていますか?
ありがとうございます!
EDIT:尋ねたよう:エラーは次のとおりです。
Line 511, Char 7, Object doesn't support this property or method.
そしてここでは、完全な出力です:http://pastie.org/1355610
おかげで再び!
エラーの原因となっている行は本当ですか?私はIEの行番号を信頼しませんが、その値をハードコーディングして確認し、それが動作するかどうかを確認することができます。どのようなエラーが出ますか?実際のソースではなく、レンダリングされたコード(「ソースの表示」)で質問を更新してください。 '<? PHPのエコー 'はIEが見ているものではないので、私たちはそれほど役に立ちません。例えば、 '$ sondage-> id'が文字列または空の値を返す場合、これはどのブラウザーでも破られます。 –
あなたはまったく正しい、私は問題を更新しました。ありがとう:) – TomShreds
IEから取得しているエラーメッセージは何ですか? – Phrogz