Avatar of willsherwood
willsherwood
 asked on

Javascript question: TypeError: $(...).on is not a function

I'm using the following script.  Can anyone help debug?     Thank you!

<head>

 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>

<script type="text/javascript">

$(document).ready(function() {  // script wrapper

      $('textarea, input').on('blur', function() {
            var itemID = $(this).attr('id');
            var itemVal = $(this).val();
            var itemVal = itemVal.replace(/\n/g, '<br />');
            var itemVal = itemVal.replace(/&/g, 'and');
            var itemstring = "ID=" + itemID + "&value=" + itemVal;
      
            processChange(itemstring);
      });

      function processChange(itemstring){
            //console.log(itemstring);
            //return false;
            $.ajax({
                  type: "GET",
                  url: "php/update.php",
                  data: itemstring,
                  complete: function(data) {
                        var Resp = data.responseText;
                        //console.log(Resp);
                  },
                  success: function() {
                        $('#saved').css('display', 'block');
                        setTimeout(function() {
                              $('#saved').animate({
                                    opacity: 0,
                              }, 500, function(){
                                    $('#saved').css('display', 'none').css('opacity', '1');
                              });
                        }, 1000);
                  }
            });
      }// end ProcessChange

}); // end script wrapper
 
</script>

</head>
JavaScript

Avatar of undefined
Last Comment
willsherwood

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Russ Suter

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
willsherwood

ASKER
thank you
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck