Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery.type() has been deprecated and can easily be replaced with vanilla typeof. Slick broken with jQuery 4! #4316

Open
JPustkuchen opened this issue Dec 17, 2024 · 2 comments

Comments

@JPustkuchen
Copy link

short description of the bug / issue, provide more detail below.
Slick uses $.type() aka jQuery.type() - See https://api.jquery.com/jQuery.type/

Here are the two lines in Slick code where it is used:
https://github.com/search?q=repo%3Akenwheeler%2Fslick%20%24.type&type=code

jQuery.type() has been deprecated in jQuery 3,3 and removed in jQuery 4 - so Slick is broken.

There's a super simple replacement in Vanilla JS:
typeof value

This is the CoPilot answer:

Since jQuery.type() is deprecated in jQuery 4, you can use the native JavaScript typeof operator as a replacement. Here's how you can do it:

// Using jQuery.type()
var type = jQuery.type(value); // Deprecated in jQuery 4

// Using native JavaScript typeof
var type = typeof value;

The typeof operator returns a string indicating the type of the unevaluated operand. It's a straightforward and efficient way to get the type of a variable in JavaScript.

Would you like more examples or further assistance with jQuery 4?

====================================================================

[ paste your jsfiddle link here ]

TODO

====================================================================

Steps to reproduce the problem

Try to use Slick with jQuery 4

====================================================================

What is the expected behaviour?

Slick works

====================================================================

What is observed behaviour?

Slick is broken

====================================================================

More Details

  • Which browsers/versions does it happen on? All
  • Which jQuery/Slick version are you using? 4
  • Did this work before? In jQuery 3
@JPustkuchen
Copy link
Author

#494 #3283

@JPustkuchen
Copy link
Author

Here's the MR to fix this: #4221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant