Why is my jQuery not loading in IE?

I did this javascript quiz: http://utbm.trunat.fr/CIP/quiz/

It works in a normal browser, but does not even load from Internet Explorer.

This means that it does not recognize the function initQuiz().

Do you have any idea how I can fix this?

+5
source share
1 answer
  • Internet Explorer does not accept trailing comma:

    question = {'texte': $(this).attr("texte"),
        'sound': $(this).attr("sound"),}
    
  • Apparently, another error appears from this line:

    $('title').html(QUIZ_TITLE[lang]);
    

    Turns out you can not set the header, as in IE . Use instead document.title = QUIZ_TITLE[lang].

  • , question var, ​​IE. , , response. loadXML :

    function loadXML(xml) {
       $(xml).find("question").each(function() {
        var question = {'texte': $(this).attr("texte"), 'sound': $(this).attr("sound")};
    
          reponses = [];
          $(this).find('carre').find('reponse').each(function() {
            var reponse = {'texte': $(this).text(), 'sound': $(this).attr("sound"), 'bonne': false};
            if($(this).attr('bonne') == "vrai") reponse['bonne'] = true;            
            reponses.push(reponse);
         });
    
         question['reponses'] = reponses;
         questions.push(question);
       });
       startGame(questions);
    }
    
  • , .

    if($(this).attr('data-type') == 'true')
    

    data-type "true", , boolean true:

    $('#r'+(i+1)+'input').attr('data-type', r.bonne);
    

    , , , :

    $('#r'+(i+1)+'input').attr('data-type', r.bonne.toString());
    
+10

All Articles