Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: $.debounce is not a function

Tags:

jquery

I am using this code:

function resizeJquerySteps() {
    $('.wizard .content').animate({
        height: $('.body.current').outerHeight()
    }, 'slow');
}

$(window).resize($.debounce(250, resizeJquerySteps));

And receiving this error TypeError: $.debounce is not a function is there another way to write this with no error?

like image 446
David Brierton Avatar asked Jun 09 '16 15:06

David Brierton


People also ask

What does TypeError X is not a function mean?

TypeError: "x" is not a function The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function.

What does the JavaScript error “is not a function” mean?

The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function. Message TypeError: Object doesn't support property or method {x} (Edge) TypeError: "x" is not a function

What is the JavaScript exception “is not a function”?

The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function. What went wrong? It attempted to call a value from a function, but the value is not actually a function. Some code expects you to provide a function, but that didn't happen.


1 Answers

For me debounce is working on added below script in HTML:

<script src="http://benalman.com/code/projects/jquery-throttle-debounce/jquery.ba-throttle-debounce.js"></script>

And js code is:-

 $("#confirmNewPassword").on("keyup keypress",($.debounce(500, function () { console.log("working debauncing")})))

Hope this will work fine for you as well. Thanks.

like image 171
Akshaykumar Mande Avatar answered Sep 23 '22 17:09

Akshaykumar Mande