0

「if」条件を AJAX xml 解析に適用しようとしていますが、できません。これは私のコードです

<script>

$(document).ready(function()
     {
          $.ajax({
          type: "GET",
          url: "http://domain.com/file.xml",
          dataType: "xml",
          success: function(xml) {

                 $(xml).find("something").each(function(){
                         if (data[i]["somefield"] == 1) {
                                $("#output").append("HOLAAAA");
                         } else {
                                $("#output").append("MOLOOOOOOOOOO");
                         }

                  });
          },
          error: function() {
                 alert("Can't retrieve data");
          }

          });

     });
</script>

しかし、それは実行されません。誰でも私を助けることができますか?

どうもありがとうございました

4

1 に答える 1