title: Uncaught TypeError: Cannot read property 'indexOf' of undefined (observer-scripts.js)
body: <p>Good day,</p>
  
  <p>I am very new to the world of coding, and need some help from experts. Below is the javascript error I have noticed in the jQuery(document) file:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'indexOf' of undefined</p>
  </blockquote>
  
  <p>The error is being pointed to this: <code>if (url.indexOf("?") != -1) {</code></p>
  
  <p>Your assistance will be much appreciated.</p>
  
  <pre><code>jQuery(document).ready(
  
      //tabs
  
      function($) {
           "use strict";
          $('.tabber-container').each(function() {
              $(this).find(".tabber-content").hide();
              $(this).find("ul.tabs li:first").addClass("active").show();
              $(this).find(".tabber-content:first").show();
          });
          $("ul.tabs li").click(
                  function(e) {
                      $(this).parents('.tabber-container').find("ul.tabs li")
                              .removeClass("active");
                      $(this).addClass("active");
                      $(this).parents('.tabber-container').find(
                              ".tabber-content").hide();
                      var activeTab = $(this).find("a").attr("href");
                      $(this).parents('.tabber-container').find(activeTab)
                              .fadeIn();
                      e.preventDefault();
                  });
          $("ul.tabs li a").click(function(e) {
              e.preventDefault();
          });
  
          //ticker
  
      function tick(){
      $("ul.ticker-list li:first").animate({marginLeft : '-200px'},400,function() {$(this).detach().appendTo("ul.ticker-list").removeAttr("style");
          });
      }
  
      var interval = setInterval(tick, 5000);
  
          $('ul.ticker-list li').hover(function() {
              clearInterval(interval);
          }, function() {
              interval = setInterval(tick, 5000);
          });
  
    //Gallery slider
            $('.post-page-gallery-thumbnails').flexslider({
              animation: 'slide',
              controlNav: false,
              animationLoop: false,
              slideshow: false,
              itemWidth: 121,
              itemMargin: 1,
              directionNav: true,
              asNavFor: '.post-page-gallery-slider'
            });
  
            $('.post-page-gallery-slider').flexslider({
              animation: 'fade',
              controlNav: false,
              animationLoop: false,
              slideshow: false,
              sync: '.post-page-gallery-thumbnails'
            });
  
          //carousel
  
          $('.carousel').flexslider({
              animation : 'slide',
              itemWidth : 161,
              itemMargin : 16,
              move : 2,
              slideshow : false,
              start : function() {
                  $('.carousel li').css('visibility', 'visible');
              },
          });
  
          //video type page carousel
  
          $('.tv-carousel').flexslider({
              animation : 'slide',
              itemWidth : 161,
              itemMargin : 16,
              move : 2,
              slideshow : false,
              controlNav : false
          });
  
          //video type page ajax
  
          $('.ajax').click(
                  function(event) {
                      event.preventDefault();
                      var post_id = $(this).attr("href");
  
                      jQuery.ajax({
                          post : post_id,
                          type : "POST",
                          data : {id : post_id},
                          success : function(output) {
                              $(".tv-video-wrapper").replaceWith(
                                      $('.tv-video-wrapper', output));
                          }
                      });
                  });
  
          //keyboard navigation next prev         
             $(document).keydown(function(e) {
                  var url = false;
              if (e.which == 37) {  // Left arrow key code
                      url = $('.previous-title a').attr('href');
                  }
              else if (e.which == 39) {  // Right arrow key code
                      url = $('.next-title a').attr('href');
              }
              if (url) {
                      window.location = url;
              }
          });
  
          //menu button for responsive mobile
  
  
          $("#mob-menu").click(function() {
              $("#main-nav ul").toggleClass("active");
              $(this).toggleClass("active");
  
          });
  
          //back to top button
  
          $('.back-2-top').click(function() {
              $('html, body').animate({
                  scrollTop : 0
              }, 'fast');
              return false;
          });
  
          //hover for Three-posts
  
          $(".three-posts li").hover(
                function () {
                  $(".three-posts li").removeClass('three-hover');
                  $(this).addClass('three-hover');
                });
  
          //simple IE fix for iframe embeds z-index
  
          $('iframe').each(function() {
              var url = $(this).attr("src");
              var char = "?";
              if (url.indexOf("?") != -1) {
                  var char = "&amp;";
              }
              $(this).attr("src", url + char + "wmode=transparent");
          });
      });
  </code></pre>