I am working on updating jQuery version of our applications from jquery version 1.7 to 3.6 so, I am facing issue with 'trim' method. we have used trim method like in old jQuery version but it has changed in latest jQuery 3.6 so, I have modified it using accordingly to 3.6 but still it is showing error as '$.trim(...).val is not a function'
my old jQuery script(1.7):
var my_variable1 = $("#my_variable1_id").val().trim();
my new jQuery trim method is (3.6):
var my_variable1 = $("#my_variable1_id").val() === null ? '' : $.trim("#my_variable1_id").val();
Any help would be appreciated, Thanks.
trim
method as a prototype so that you can use that no matterjQuery
version has it or not.