javascript – A problem with Jquery code on wordpress

this code works for desktop and android but failed on ios. On Iphone website just reload and show a problem repeatedly occurred error.
<script>
var $ = jQuery;
jQuery(document).ready(function(){
    setTimeout(function(){
        console.log('Google Ad iframe')
        $('iframe').attr('title', 'Google Ads');        
    }, 3000)

    jQuery.event.special.touchstart = {
        setup: function( _, ns, handle ){
            this.addEventListener("touchstart", handle, { passive: true });
        }
    };  
  setTimeout(function(){

    $(".en-col.ticker-items, .en-general-banner.en-standard-section-spacing, #ocvb-shortcode-container, .post-page-entry .entry-metas, .pagination .nav-links").attr("dir", "ltr");
    $('input(type="search")').attr("placeholder", "کچھ ٹائپ کریں");
    $('#submit').attr("value", "تلاش کریں");
    setTimeout(function(){
      $('#main-menu .menu-toggle').on('click', function(){
        event.preventDefault();
      })
      //  $('.owl-item li.posted-date').remove();
      $('.posted-date').remove();
      $('.owl-item .Comment').remove();
    }, 500)

    replaceStr(".page-title h1", "Category:", "قسم:");
    replaceStr("div.nav-next a", "Next Post", "اگلی پوسٹ");
    replaceStr("div.nav-previous a", "Prev Post", "پچھلی پوسٹ");
    replaceStr("#reply-title", "Leave a Reply", "جواب چھوڑیں");
    replaceStr(".related-posts-title h3", "Related News", "متعلقہ خبریں");
    replaceStr(".wpd-thread-info", "Comments", "جواب چھوڑیں");  
    $('#wpd-field-submit-0_0').attr('value', 'جواب چھوڑیں')
    setTimeout(function(){
      $('#main-menu .menu-toggle').html('<i class="fa fa-bars"></i>');
    // replaceStr(".menu-toggle", "Menu", "مینو");
    }, 500)


    function replaceStr(selector, str, repStr){
        jQuery(selector).text(jQuery(selector).text().replace(str, repStr))
    }
    $(window).scroll(function(){
      var sticky = $('.main-navigation.mobile, #search-toggle'),
          scroll = $(window).scrollTop();

      if (scroll >= 100) sticky.addClass('sticky');
      else sticky.removeClass('sticky');
    });

    $(window).scroll(function(){
      var sticky = $('#search-toggle'),
          scroll = $(window).scrollTop();

      if (scroll >= 100) sticky.addClass('sticky');
      else sticky.removeClass('sticky');
    });

  
    function addStylesheetURL(url) {
      var link = document.createElement('link');
      link.rel = 'stylesheet';
      link.href = url;
      document.getElementsByTagName('head')(0).appendChild(link);
    }

//     Load Tangerine & Cantarell
    addStylesheetURL('https://fonts.googleapis.com/earlyaccess/notonastaliqurdu.css?display=swap'); 

    $('div.en-general-banner .banner-inner').css('display', 'block');
  }, 2000);

    $('section.en-front-widget-5').each(function(index){
      var ele = $(this);
      setTimeout(function(){
        ele.css('display', 'block');
      }, (index+2))
    })
});
</script>