views:

58

answers:

2

I am hoping to get some help on this issue. Some users on IE have been reporting this javascript issue, but I have been unable to re-produce it.

In essence, for some class of windows IE users, the game doesn't work (or $.ajax() is not working).

What I know:

  • I swapped out an ajax call (ajax_init_trainer) and used a standard link with some request parameters to do the initialization and ppl seemed to get passed the problem until they hit the next ajax call.

I read somewhere that IE does crazy caching so you need to make the urls unique, which is why i added the _requestno parameter. However, setting the cache:false is said to also do this. This didn't fix it for someone who was complaining.

function done(res, status) {
       var data = JSON.parse(res.responseText);
       hide_loading();
       if (status == "success") {
               window.location.href="/bamo/battle/?{{ fb_sig}}";
       }
       else {
           display_alert("Problem!",data.msg,$("#notifications"));
       }
};

$(".monster_select_class").click(function() {
       $(this).attr("src","{{MEDIA_URL}}/bamo/button_select_click.png");
       monster_class = $(this).attr("monster_class");
       monster_type = $(this).attr("monster_type");
       ajax_init_trainer(monster_class,monster_type);
   });

function ajax_init_trainer(trainer_class,monster_type) {
       var data = {trainer_class:trainer_class,monster_type:monster_type};
       var d = new Date();
       var args = { type:"POST",url:"/bamo/api/init_trainer/?_requestno="+d.getTime(),data:data,contentType:"application/json;", dataType: "json",cache:false,complete:done};
       $.ajax(args);
       return false;
};
+1  A: 

I always have problems like that on IE just because of some "." or ";" out of place, or missing... usually, it's IE 7 the complainer...

The above text it's a tip :)

Btw: do you have a link to test that problem of yours ?

Zuul
+1  A: 

I have had a problem similar to this. It turned out to be that I set the server to use a text encoding that IE doesn't understand: "UTF8". I changed it to "UTF-8" and that resolved the issue. This gets set in the http response header. If the response header has an encoding IE doesn't recognize, Fttzzt.

I don't know if this is the problem you're having, but it's something you can check.

If it's something involving $.ajax failing then definately take a close look at what the request and response headers are, when using IE. Use http://www.fiddler2.com/fiddler2/

Breton