Ajax post does not work on mobile

Ajax post does not work on mobile

Hello,

I am creating a filter for my website with ajax and it works correctly from the computer. But when I enter from any mobile (android, ios, etc) it does not show the results. 

The code I use is as follows:

jQuery version: v3.3.1

  1. <script>

  2. $(document).ready(function(){

  3.     filter_data();

  4.     function filter_data()
  5.     {
  6.         $('.filter_data').html('<div class="spinner-border" role="status"></div>');
  7.         var action = 'fetch_data';
  8.         var categoria = get_filter('categoria');
  9.         var etiqueta = get_filter('etiqueta');
  10.         
  11.         $.ajax({
  12.             type:"POST",
  13.             url:"category.php",
  14.             cache: false,
  15.             data:{action:action, categoria:categoria, etiqueta:etiqueta},
  16.             success:function(data){
  17.                 $('.filter_data').html(data);
  18.             }
  19.         });
  20.         
  21.     }

  22.     function get_filter(class_name)
  23.     {
  24.         var filter = [];
  25.         $('.'+class_name+':checked').each(function(){
  26.             filter.push($(this).val());
  27.         });
  28.         return filter;
  29.     }

  30.     $('.common_selector').click(function(){
  31.         filter_data();
  32.     });
  33.     

  34. });
  35. </script>

I find it very strange that it works on PC but not on mobile. What's going on?

I've been looking on the internet but I can't find a solution :/

Sorry for my bad English, I use translator.