3

location.reload() not working properly in mobile devices...

location.reload() is working fine on desktop browsers but not working on mobile browsers (android)...

i work in Django selected fileds that come from ajax selections of modelchoicefields querysets are lost after window.location.reload(). everthing works fine in desktops but not in mobile devices.

what should i change or add???

you can see the difference in added image...difference between desktop and mobile device working..

code is a standart ajax call for Django to dynamically select fields that are related to the previous selection...

<script>
    function prosecFunction() {
        var response = '';
        var selected = document.getElementById("id_proje").value;
        console.log(selected);
        $.ajax({
          url : "demirbas_ariza_listesi/",
          type : "GET",
          dataType: "text",
          data : {
            'selected' : selected,
              },
          success: function() {
              window.location.reload();
               },
          failure: function() {
              alert("hata var....veri aktarılamadı...");
              }
          });  /* ajax kapa...*/
    }
  </script>

 <script>
Levent E.
  • 31
  • 1
  • 5

1 Answers1

0

Try document.location.reload(true); instead of window.location.reload();

success: function(data){    

    document.location.reload(true);         

}
Nisal Edu
  • 7,237
  • 4
  • 28
  • 34